sharepoint server – Exception in String type error on SPFX with JQuery

I really need help to resolve Type error encountered on this function in SPFX with jQuery.

Here is the function, The return statement is failing:

var addFile = function (fileTitle, fileName, fileType, team) {
var requestUri = "../_api/web/lists/getByTitle('SPFxFiles')/items";
var requestHeaders = {
    "accept": "application/json;odata=verbose",
    "content-type": "application/json;odata=verbose",
    "X-RequestDigest": $('#__REQUESTDIGEST').val()
}
var fileData = {
    __metadata: { "type": "SP.Data.SPFxFilesListItem" },
    Title: fileTitle,
    SPFxFileName: fileName,
    SPFxFileType: fileType,
    SPFxTeam: team
};
var requestBody = JSON.stringify(fileData);
return $.ajax({
    url: requestUri,
    type: "POST",
    headers: requestHeaders,
    data: requestBody
});
{
    "resource": ".../src/webparts/orderForm/OrderFormWebPart.ts",
    "owner": "typescript",
    "code": "2769",
    "severity": 8,
    "message": "No overload matches this call.n  Overload 1 of 2, '(url: string, settings?: AjaxSettings<any>): jqXHR<any>', gave the following error.n    Argument of type '{ url: string; type: string; contentType: string; headers: { accept: string; "X-HTTP-Method": string; "X-RequestDigest": string | number | string(); "If-Match": string | number | string(); }; data: string; }' is not assignable to parameter of type 'string'.n  Overload 2 of 2, '(settings?: AjaxSettings<any>): jqXHR<any>', gave the following error.n    Type '{ accept: string; "X-HTTP-Method": string; "X-RequestDigest": string | number | string(); "If-Match": string | number | string(); }' is not assignable to type 'PlainObject<string>'.n      Property '"X-RequestDigest"' is incompatible with index signature.n        Type 'string | number | string()' is not assignable to type 'string'.n          Type 'number' is not assignable to type 'string'.",
    "source": "ts",
    "startLineNumber": 317,
    "startColumn": 8,
    "endLineNumber": 323,
    "endColumn": 3,
    "relatedInformation": (
        {
            "startLineNumber": 165,
            "startColumn": 13,
            "endLineNumber": 165,
            "endColumn": 20,
            "message": "The expected type comes from property 'headers' which is declared here on type 'AjaxSettings<any>'",
            "resource": ".../node_modules/@types/jquery/misc.d.ts"
        }
    )
}

9 – Get the paragraph fields of a content type in a loop in another page

I have added a paragraph in content type News.
I want the fields on this paragraph in my custom home page in a loop.
As The News Contents would be shown in a carousel in home page.
I am new to drupal. Can anyone help me?
I have tried using views. the content is rendered. but as the view has extra divs, the design breaks.
Drupal 9 using twig.

Using semantics view, i can modify or add classes to the div. but i needed to get rid of the outer two divs i.e. from container and views-view.html.twig. As the carousel is out of the view. and the view is acting like a single carousel entity.

Haskell: Implementing the data type LExpR as an instance of show

I am trying to implement the data type LExpr as an instance of show.

data LExpr = Var String        
                | App LExpr LExpr   
                | Lam String LExpr 

This is my code:

 instance Show LExpr where
      showsPrec d (Var str)   = showString' str
      showsPrec d (App e1 e2) = showParen (d>=6) $ showsPrec 6 e1  . showString " " . showsPrec 5  e2
      showsPrec d (Lam str e) = showParen (d>=5) $ showString ("\"++str++" -> ") . showsPrec 5 e

I am looking for some advice on how to further improve my code.

theming – Get the paragraph fields of a content type in a loop in another page drupal 9

I have added a paragraph in content type News.
I want the fields on this paragraph in my custom home page in a loop.
As The News Contents would be shown in a carousel in home page.
I am new to drupal. Can anyone help me?
I have tried using views. the content is rendered. but as the view has extra divs, the design breaks.
Drupal 9 using twig.

magento2.3 – Type Error occurred when creating object Magento 2

I have created custom module and it’s working fine in Dev, but it’s not working on Production. It’s throwing Type error.

Type Error occurred when creating object:
TinyProductCustomizationModelResourceModelProductCollectionInterceptor,
Argument 5 passed to
TinyProductCustomizationModelResourceModelProductCollectionInterceptor::__construct()
must implement interface MagentoFrameworkDBAdapterAdapterInterface
or be null, string given, called in
/var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php
on line 121 () () (2021-01-11 10:11:47) report.CRITICAL: Type Error
occurred when creating object:
TinyProductCustomizationModelResourceModelProductCollectionInterceptor
() ()

My collection file as below

<?php

namespace TinyProductCustomizationModelResourceModelProduct;

use MagentoFrameworkModelResourceModelDbCollectionAbstractCollection;

class Collection extends AbstractCollection
{

    protected $_idFieldName = 'id';

    protected function _construct()
    {
        $this->_init(
            'TinyProductCustomizationModelProduct',
            'TinyProductCustomizationModelResourceModelProduct'
        );
        parent::_construct();
    }

}

and di.xml

<type name="MagentoFrameworkViewElementUiComponentDataProviderCollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="tiny_grid_data_source" xsi:type="string">TinyProductCustomizationModelResourceModelProductCollection</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="TinyProductCustomizationModelResourceModelProductCollection" type="MagentoFrameworkViewElementUiComponentDataProviderSearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">tiny_pro</argument>
            <argument name="resourceModel" xsi:type="string">TinyProductCustomizationModelResourceModelProduct</argument>
        </arguments>
    </virtualType>

Can you please help me on this?

How to fix the taxonomy and custom post type slug/url

I have a custom taxonomy and post type.

When I click on a taxonomy item the slug changes to:

http://localhost:8888/mysite/developments/development-name-here/

And that page is using taxonomy-developments.php

But when I click on an item there which is a custom post type item, the url changes to:

http://localhost:8888/mysite/our-properties/my-first-property/

This uses single-property.php

I would have though the url should be:

http://localhost:8888/mysite/developments/development-name-here/my-first-property

Because I want to show the property belonging to that development and thus have the url indicate that.

The post type:

register_post_type('property', array(
    'supports'      => array('title', 'editor', 'thumbnail', 'page-attributes'),
    'rewrite'       => array('slug' => 'our-properties'),
    'has_archive'   => true,
    'public'        => true,
    'show_in_rest'  => true,
    'hierarchical'  => true,
    'labels'        => array(
            'name'         => 'Property',
            'add_new_item' => 'Add New Property',
            'edit_item'    => 'Edit Property', 
            'all_items'    => 'All Properties',
    ),
));

Taxonomy:

register_taxonomy('developments',array('property'), array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'show_admin_column' => true,
    'query_var' => true,
    'show_in_rest' => true,
    'rewrite' => array( 'slug' => 'developments' ),
));  

8 – Cannot upload file of type image

I am experiencing a really strange behavior I have never seen before with Drupal. I am able to upload files of every type but not images. The files system is public. The problem appears on the local test server and on the live server.

Error message:
The image upload widget shows the standard error box logging:
**The file xyz.jpg could not be uploaded.

  • This value should not be null**

This issue appears on the whole site on every image of the file field widget within the backend.
Even the file upload for Drupal’s “File Archive” does just work with every other file type than ‘jpg’, ‘jpeg’, ‘gif’, ‘png’ file types.

The issue appeared after updating to the “web/” file structure while also updating the core to 8.8. I tried to update to 8.9.12 including every module installed but the error when trying to upload a file stays.

I rechecked all the settings regarding “tmp folder” and also tested the folder access rights (chown, chmod). It is set to 777.

I updated the database (drush updb) and also rebuild the cache (drush cr).

No PHP error log is created (not in Drupals Watchdog or the apache log).

I am sure that it is not a configuration issue as I am able to upload files that are not image files without problems. Another interesting bit is that when uploading a file it is actually created in the final sites/default/files location. The file also has the correct owner and access rights.

I could not find a related issue when researching nor I am able to come up with another idea. I even tried to change the file system to private, created new entities with image or file fields and tried different image upload widgets – nothing seems to work.

Any help is greatly appreciated.

24x7technicalsupport.net| New Year 20% off | cPanel, VMware, SolusVM, Virtualizor | All Type of Server Management | Free Server Monitoring | $23 | | Proxies-free

24×7 Technical Support announce special New Year 2021, 20% off Discount on all of its services and products. 24×7 Technical Support provides outsourced Webhosting support and server management services to web hosting providers and IT companies. We provide support services using commonly used the medium of communication as helpdesk, live chat and email support. Our plans provide real 24×7 human support with customized service options to choose from. We provide custom solutions specifically designed to meet client requirement to give you assurance and peace of mind when opting for our services. Apart from web hosting technical support the other services that we provide are server management, data migration and scripts installation.
==================================================
Our Unique Strengths!

Affordable Pricing “Always”
Best Security and “Top Quality”
Response Times “Guaranteed”
Scalable Support “On demand”
==================================================
Pricing without 20% off.
Cpanel Server Management: $29/Month/server
Server Security and Harderning: 49/one time charges
VPS Server Management: $29/Month/server
Plesk Server Management: $29/Month/server
DirectAdmin Server Management: $29/Month/server
SolusVM Management: $69/month (Includes One master and One Slave)
Windows Server Management: $49/month/server (with or without control panel)
Plain Server Management : $49/month/server
Cloud Management : Starts @ $99/node
VMWare Server Management: Starting @ $49
Zimbra Management: Starting @ $49/node
=====================================================
Contact Us:
Email:
sales@24x7technicalsupport.net
Skype: sales@24x7technicalsupport.net
Live Chat
=====================================================
Our Server Management services include management and monitoring of your VPS, Dedicated Servers or even cloud servers. We specialize in Managing OpenStack and CloudStack Clusters with full support including instance level management.
=======================================================

  • All Plans include 24×7 Monitoring coverage worth $10.99/month without any cost.
  • 20% off is valid only for the first billing cycle. For more offers and details client may contact sales team on Skype.
  • We also specialize in application server management for Jboss/Tomcat as well as ready to use Cloudstack/Openstack Setups & other tailor-made setups.
  • Checkout Our Site Now!! and Get in Touch with us for promotional pricing.

========================================================

database – What type of data-base is good for storing records where each record potentially has hundreds of fields, and the fields are usually `null` values?

When I was in college, the only type of database we studied were relational databases using SQL.

However, I now have an application, where if you tried to use a relational-database, more than 90% of the cell-values would be null and tables would have thousands of columns.

Clearly, a relational database is the wrong choice.

My question is, what type of database is better suited to my application?

If you know what SQL is, then go to the next header/section-break.

In a relational database, everything is stored in spreadsheet-like tables.

Feel free to skip reading this section.

In an example of a relational database, a table recording data for apartment rentals might have the following columns:

  • Floor Area Lower Bound (e.g. 450 square feet)
  • Floor Area Upper Bound (e.g. 850 square feet)
  • Monthly Rent (e.g. $750.00)
  • Is Electric Bill is Paid by Landlord? (Boolean)
  • Is the water bill paid by the landlord
  • Street Address of the apartment (e.g. 123 somewhere lane)
  • etc…

I was thinking about creating a database for a job-applicants and job-classifieds.

Traditionally, job classifieds are stored as Unicode strings.
Computers have difficulty parsing and interpreting English.
Humans end up reading the job classifieds, and sorting the job classifieds “by hand.”

Suppose that a prospective job-applicant as no security clearance.
It would be nice if the computer would delete could all rows of the search results containing jobs for which a security clearance is required. This would save people time reading classifieds for jobs they are not qualified for.

The question is whether job J has at least one job mandatory/minimum qualification Q such that a human-being ,Sarah, does not have job-qualification Q

We are often working with 3-valued logic. In a generalized of the mathematical “law of the excluded middle“, One of the following 3 is always the case:

  • Jane has a commercial driver’s license.
  • Jane does NOT have a commercial driver’s license.
  • It is unknown whether Jane has a commercial driver’s license or not.

We want a database where:

  • Roles/Positions have qualifications.
  • Actors/Job-applicants have qualifications.

If a job requires at least 2 years of Java-programming, and Ian has 8 years of java programming, then we choose NOT to delete that job from the search results we show to Ian

I would prefer that bots filter and prune the search-space as much as possible.

A bot could run a search query, such as “furniture mover” using an traditional nothing-fancy search engine. After that, a bot could identify which job-qualification would split the search results most nearly in half. A 40%-60% split is better than 1% to 99%.

Maybe a commercial driver's license is a suitable job-qualification. After identifying an attribute to prune-on, the computer can ask the human something like, “do you have a commercial driver’s license?” The answer might cut the search space in half.

Every time the end user is asked a question about their qualifications, the computer stores the answer in a data-base.

A SQL table for job-applicants would have more than 2,000 columns (i.e. job qualifications). Examples of column headers are shown below:

  • Number of years of Network domain experience (float)
  • Number of years of experience operating fork-lifts (float)
  • Are you a licensed plumber (Boolean)
  • Do you have a Ph.D in psychology? (Boolean)
  • Are you a licensed in the United States to be a professional counselor (LPC)?
  • Number of years of experience writing computer code for front ends (float)
  • Do you have a CDL (commercial driver’s license)?

I am not willing to record, for every human being under the sun, whether that person has experience using a fork-lift or not, cooking Chinese food, or writing computer programs in java-script.

Perhaps we can “tag” each job-applicant.

  • Some users are “tagged commercial driver's license = yes
  • Some users are “tagged commercial driver's license = no
  • Some users do not have a tag for commercial driver's license at all.

What kind of data-base best supports what I am trying to do?

The website we are currently using, stackexchange.com, has a maximum of something like 8 tags per question.

I would like to be able to support at least a dozen, if not a couple hundred, tags for each stage-role (job) or single stage-actor (job-applicant)