Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] type error on multiselect unmarshal #17069

Open
wants to merge 2 commits into
base: 11.2
Choose a base branch
from

Conversation

aMH-techsigns
Copy link

@aMH-techsigns aMH-techsigns commented May 17, 2024

Changes in this pull request

Resolves : A type error thrown by strlen if $value['value'] is NULL

Provide a stricter condition to avoid exception in grid view.

Additional info

We have not yet figured out which circumstances lead to the exect status so that $value['value'] is NULL. What we can say is that the exception occurs in the "grid view" while we where searching for a specific product (on the articleNumber attribute col with the filter function of the col).

Timestamp: Fri May 17 2024 12:36:56 GMT+0200 (Mitteleuropäische Sommerzeit)
Status: 500 | 
URL: /admin/object/grid-proxy?classId=Product&folderId=38784&xaction=read&_dc=1715942216818
Method: POST
Message: strlen(): Argument #1 ($string) must be of type string, null given
Trace: 
in /var/www/html/vendor/pimcore/pimcore/lib/DataObject/ClassificationstoreDataMarshaller/Multiselect.php:37
#0 /var/www/html/vendor/pimcore/pimcore/lib/DataObject/ClassificationstoreDataMarshaller/Multiselect.php(37): strlen(NULL)
#1 /var/www/html/vendor/pimcore/pimcore/models/DataObject/Classificationstore/Dao.php(252): Pimcore\DataObject\ClassificationstoreDataMarshaller\Multiselect->unmarshal(Array, Array)
#2 [internal function]: Pimcore\Model\DataObject\Classificationstore\Dao->load()
#3 /var/www/html/vendor/pimcore/pimcore/lib/Model/AbstractModel.php(220): call_user_func_array(Array, Array)
#4 /var/www/html/vendor/pimcore/pimcore/models/DataObject/ClassDefinition/Data/Classificationstore.php(491): Pimcore\Model\AbstractModel->__call('load', Array)
#5 /var/www/html/vendor/pimcore/pimcore/models/DataObject/Concrete/Dao.php(152): Pimcore\Model\DataObject\ClassDefinition\Data\Classificationstore->load(Object(Pimcore\Model\DataObject\Product), Array)
#6 /var/www/html/vendor/pimcore/pimcore/models/DataObject/Concrete/Dao.php(69): Pimcore\Model\DataObject\Concrete\Dao->getData()
#7 /var/www/html/vendor/pimcore/pimcore/models/DataObject/AbstractObject.php(243): Pimcore\Model\DataObject\Concrete\Dao->getById(48225)
#8 /var/www/html/vendor/pimcore/pimcore/models/DataObject/Listing/Dao.php(66): Pimcore\Model\DataObject\AbstractObject::getById(48225)
#9 [internal function]: Pimcore\Model\DataObject\Listing\Dao->load()
#10 /var/www/html/vendor/pimcore/pimcore/lib/Model/AbstractModel.php(220): call_user_func_array(Array, Array)
#11 /var/www/html/vendor/pimcore/admin-ui-classic-bundle/src/Controller/Admin/DataObject/DataObjectActionsTrait.php(120): Pimcore\Model\AbstractModel->__call('load', Array)
#12 /var/www/html/vendor/pimcore/admin-ui-classic-bundle/src/Controller/Admin/DataObject/DataObjectController.php(1761): Pimcore\Bundle\AdminBundle\Controller\Admin\DataObject\DataObjectController->gridProxy(Array, 'object', Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher), Object(Pimcore\Bundle\AdminBundle\Helper\GridHelperService), Object(Pimcore\Localization\LocaleService))
#13 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Pimcore\Bundle\AdminBundle\Controller\Admin\DataObject\DataObjectController->gridProxyAction(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher), Object(Pimcore\Bundle\AdminBundle\Helper\GridHelperService), Object(Pimcore\Localization\LocaleService), Object(Pimcore\Bundle\AdminBundle\Security\CsrfProtectionHandler))
#14 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /var/www/html/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/www/html/public/index.php(36): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#17 {main}

The exception points to the method we fixed in this merge request. Obviously this code missed some stricter conditions.

Copy link

Review Checklist

  • Target branch (11.2 for bug fixes, others 11.x)
  • Tests (if it's testable code, there should be a test for it - get help)
  • Docs (every functionality needs to be documented, see here)
  • Migration incl. install.sql (e.g. if the database schema changes, ...)
  • Upgrade notes (deprecations, important information, migration hints, ...)
  • Label
  • Milestone

@aMH-techsigns aMH-techsigns changed the title Bugfix type error on multiselect unmarshal [BUG] type error on multiselect unmarshal May 17, 2024
Copy link

sonarcloud bot commented May 17, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@CLAassistant
Copy link

CLAassistant commented May 17, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants