pixelant / pxa_product_manager

Product Manager. Allow to create and list products on a site. Create dynamical attributes for products. Filter by categories and attributes
11 stars 12 forks source link

[BUG] Non-admins unable to set initial attribute value #400

Closed stefanwimmer128 closed 1 year ago

stefanwimmer128 commented 1 year ago

Describe the bug Non-admins are not able to set an initial attribute value for a product.

To Reproduce Steps to reproduce the behavior:

  1. Create Product
  2. Assign product to product type with attributes
  3. Set an attribute value
  4. Save
  5. See error: 1: recordEditAccessInternals() check failed. [ERROR: The "languageField" field named "sys_language_uid" was not found in testing record!]

Expected behavior Create product and save product and attribute value

Desktop (please complete the following information):

Additional context The $incomingFieldArray in DataHandler->process_datamap() (typo3/sysext/core/Classes/DataHandling/DataHandler.php 828) for attribute values on creation does not contain sys_language_uid. Since attribute values are stored under the pid 0, DataHandler->addDefaultPermittedLanguageIfNotSet() (typo3/sysext/core/Classes/DataHandling/DataHandler.php 7977) can't set a default sys_language_uid based on site configuration. Afterwards BackendUserAuthentication->recordEditAccessInternals() (typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php 767) checks for the existence of sys_language_uid and does not find it, thus producing the error. This check is completely bypassed when the backend user is an admin.