Skip to content

magento man

Error when compiling: Declaration of X must be compatible with Y

I’m new to Magento and working on upgrading an existing project to 2.4.3. When running php -dmemory_limit=5G bin/magento setup:di:compile I’m encountering an error: Fatal error: Declaration of XRecurringServiceModelExportMetadataProvider::getHeaders(MagentoFrameworkViewElementUiComponentInterface $component) must be compatible with MagentoUiModelExportMetadataProvider::getHeaders(MagentoFrameworkViewElementUiComponentInterface $component): array in /code/X/RecurringService/Model/Export/MetadataProvider.php on line… Read More »Error when compiling: Declaration of X must be compatible with Y

How to convert extension attribute type string to type object?

As type string:(but I need as an object) <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Api/etc/extension_attributes.xsd”> <extension_attributes for=”MagentoSalesApiDataOrderInterface”> <attribute code=”admin_user” type=”string”/> </extension_attributes> </config> should be something like: <attribute code=”admin_user” type=”pathtoobject”/> Plugin: <?php declare(strict_types=1); namespace CollinsOrderTrackingPlugin; use MagentoSalesApiDataOrderInterface; use MagentoSalesApiDataOrderSearchResultInterface; use MagentoSalesApiOrderRepositoryInterface; use CollinsOrderTrackingModelAttributesFactory;… Read More »How to convert extension attribute type string to type object?

Products “X” and “Y” have the same set of attribute values

I’m doing something like this foreach ($arrayItemsToReplace as $key => $item){ $product->getMediaGalleryImages()->removeItemByKey($key); $product->getMediaGalleryImages()->addItem($item); } if(count($arrayItemsToReplace)){ try{ $this->productRepository->save($product); But this is triggering me this error on the save action Products “X” and “Y” have the same set of attribute values. I’m… Read More »Products “X” and “Y” have the same set of attribute values

setup:di:compile fails after updating to 2.4.4

I upgraded from 2.4.2 to 2.4.4. Everything seemed to work, until I ran setup:di:compile. I get this error: MiBClass ‘ZendI18nValidatorPhoneNumber’ not found#0 /var/www/html/magento2/vendor/composer/ClassLoader.php(571): include() #1 /var/www/html/magento2/vendor/composer/ClassLoader.php(428): ComposerAutoloadincludeFile() #2 [internal function]: ComposerAutoloadClassLoader->loadClass() #3 [internal function]: spl_autoload_call() #4 /var/www/html/magento2/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists() #5 /var/www/html/magento2/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117):… Read More »setup:di:compile fails after updating to 2.4.4

“Directory is not under storage root path magento 2

module.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Module/etc/module.xsd”> <module name=”Greenplank_UploaderFix”> </module> </config> registration.php <?php MagentoFrameworkComponentComponentRegistrar::register( MagentoFrameworkComponentComponentRegistrar::MODULE, ‘Greenplank_UploaderFix’, __DIR__ ); di.xml <?xml version=”1.0″ ?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <preference for=”MagentoFrameworkAppFilesystemDirectoryResolver” type=”GreenplankUploaderFixAppFilesystemDirectoryResolver”/> </config> DirectoryResolver.php <?php namespace GreenplankUploaderFixAppFilesystem; use MagentoFrameworkAppFilesystemDirectoryList; /** * Magento directories resolver. */… Read More »“Directory is not under storage root path magento 2