Skip to content

Admin product page error when all product attributes are set to global scope #39646

Open
@mfickers

Description

Preconditions and environment

  • Magento version 2.4.7-p4
  • First noticed on a project that runs in single store mode, but is reproducible in a default setup as well

Steps to reproduce

  1. Set all product attributes to global scope
UPDATE catalog_eav_attribute 
SET is_global = 1 
WHERE attribute_id IN (
    SELECT attribute_id FROM eav_attribute 
    WHERE entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product')
);
  1. Navigate to product grid in admin panel
  2. Click on "Add Product"

Expected result

Product edit page is rendered correctly and usable

Actual result

Product edit page shows an error and is unusable

Additional information

Stack Trace

ValueError: PDO::prepare(): Argument #1 ($query) cannot be empty in /var/www/html/vendor/magento/zend-db/library/Zend/Db/Statement/Pdo.php:58
Stack trace:
#0 /var/www/html/vendor/magento/zend-db/library/Zend/Db/Statement/Pdo.php(58): PDO->prepare()
#1 /var/www/html/vendor/magento/zend-db/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Pdo->_prepare()
#2 /var/www/html/vendor/magento/zend-db/library/Zend/Db/Adapter/Pdo/Abstract.php(188): Zend_Db_Statement->__construct()
#3 /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(950): Zend_Db_Adapter_Pdo_Abstract->prepare()
#4 /var/www/html/vendor/magento/zend-db/library/Zend/Db/Adapter/Abstract.php(479): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->prepare()
#5 /var/www/html/vendor/magento/zend-db/library/Zend/Db/Adapter/Pdo/Abstract.php(242): Zend_Db_Adapter_Abstract->query()
#6 /var/www/html/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(614): Zend_Db_Adapter_Pdo_Abstract->query()
#7 /var/www/html/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(639): Magento\Framework\DB\Adapter\Pdo\Mysql->Magento\Framework\DB\Adapter\Pdo\{closure}()
#8 /var/www/html/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(614): Magento\Framework\DB\Adapter\Pdo\Mysql->performQuery()
#9 /var/www/html/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(703): Magento\Framework\DB\Adapter\Pdo\Mysql->_query()
#10 /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(95): Magento\Framework\DB\Adapter\Pdo\Mysql->query()
#11 /var/www/html/vendor/magento/zend-db/library/Zend/Db/Adapter/Abstract.php(737): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query()
#12 /var/www/html/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(1094): Zend_Db_Adapter_Abstract->fetchAll()
#13 /var/www/html/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php(164): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->fetchAll()
#14 /var/www/html/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php(113): Magento\Catalog\Model\Attribute\ScopeOverriddenValue->initAttributeValues()
#15 /var/www/html/app/code/Magento/Catalog/Model/AbstractModel.php(328): Magento\Catalog\Model\Attribute\ScopeOverriddenValue->getDefaultValues()
#16 /var/www/html/generated/code/Magento/Catalog/Model/Product/Interceptor.php(1463): Magento\Catalog\Model\AbstractModel->getAttributeDefaultValue()
#17 /var/www/html/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/UsedDefault.php(87): Magento\Catalog\Model\Product\Interceptor->getAttributeDefaultValue()
#18 /var/www/html/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/UsedDefault.php(69): Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\UsedDefault->titleUsedDefault()
#19 /var/www/html/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Composite.php(81): Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\UsedDefault->modifyMeta()
#20 /var/www/html/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/ProductDataProvider.php(73): Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Composite->modifyMeta()
#21 /var/www/html/lib/internal/Magento/Framework/View/Element/UiComponentFactory.php(330): Magento\Catalog\Ui\DataProvider\Product\Form\ProductDataProvider->getMeta()
#22 /var/www/html/lib/internal/Magento/Framework/View/Element/UiComponentFactory.php(231): Magento\Framework\View\Element\UiComponentFactory->mergeMetadata()
#23 /var/www/html/lib/internal/Magento/Framework/View/Layout/Generator/UiComponent.php(137): Magento\Framework\View\Element\UiComponentFactory->create()
#24 /var/www/html/lib/internal/Magento/Framework/View/Layout/Generator/UiComponent.php(103): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent()
#25 /var/www/html/lib/internal/Magento/Framework/View/Layout/GeneratorPool.php(93): Magento\Framework\View\Layout\Generator\UiComponent->process()
#26 /var/www/html/lib/internal/Magento/Framework/View/Layout.php(365): Magento\Framework\View\Layout\GeneratorPool->process()
#27 /var/www/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(68): Magento\Framework\View\Layout->generateElements()
#28 /var/www/html/lib/internal/Magento/Framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#29 /var/www/html/lib/internal/Magento/Framework/View/Page/Builder.php(65): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#30 /var/www/html/lib/internal/Magento/Framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#31 /var/www/html/lib/internal/Magento/Framework/View/Layout.php(271): Magento\Framework\View\Layout\Builder->build()
#32 /var/www/html/lib/internal/Magento/Framework/View/Layout.php(896): Magento\Framework\View\Layout->build()
#33 /var/www/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(293): Magento\Framework\View\Layout->getBlock()
#34 /var/www/html/app/code/Magento/Backend/Model/View/Result/Page.php(26): Magento\Framework\View\Layout\Interceptor->getBlock()
#35 /var/www/html/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(23): Magento\Backend\Model\View\Result\Page->setActiveMenu()
#36 /var/www/html/app/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction.php(89): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu()
#37 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Catalog\Controller\Adminhtml\Product\NewAction->execute()
#38 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->___callParent()
#39 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->Magento\Framework\Interception\{closure}()
#40 /var/www/html/generated/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction/Interceptor.php(23): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->___callPlugins()
#41 /var/www/html/lib/internal/Magento/Framework/App/Action/Action.php(111): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->execute()
#42 /var/www/html/app/code/Magento/Backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#43 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#44 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->___callParent()
#45 /var/www/html/app/code/Magento/Backend/App/Action/Plugin/Authentication.php(145): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->Magento\Framework\Interception\{closure}()
#46 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#47 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->Magento\Framework\Interception\{closure}()
#48 /var/www/html/generated/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction/Interceptor.php(32): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->___callPlugins()
#49 /var/www/html/lib/internal/Magento/Framework/App/FrontController.php(245): Magento\Catalog\Controller\Adminhtml\Product\NewAction\Interceptor->dispatch()
#50 /var/www/html/lib/internal/Magento/Framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#51 /var/www/html/lib/internal/Magento/Framework/App/FrontController.php(146): Magento\Framework\App\FrontController->processRequest()
#52 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#53 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#54 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#55 /var/www/html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#56 /var/www/html/lib/internal/Magento/Framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#57 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch()
#58 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->___callParent()
#59 /var/www/html/app/code/Magento/ApplicationPerformanceMonitor/Plugin/ApplicationPerformanceMonitor.php(38): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#60 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\ApplicationPerformanceMonitor\Plugin\ApplicationPerformanceMonitor->aroundLaunch()
#61 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#62 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins()
#63 /var/www/html/lib/internal/Magento/Framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#64 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#65 {main}

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Area: ProductComponent: CatalogIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.7-p4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions