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

Something broken? #2545

Closed
sreichel opened this issue Sep 3, 2022 · 28 comments
Closed

Something broken? #2545

sreichel opened this issue Sep 3, 2022 · 28 comments

Comments

@sreichel
Copy link
Contributor

sreichel commented Sep 3, 2022

19.4.x

Can someone reproduce? When i select an item from admin grid i get ...

Warning: Illegal offset type  in /var/www/html/lib/Varien/Object.php on line 263

#0 /var/www/html/lib/Varien/Object.php(263): mageCoreErrorHandler(2, 'Illegal offset ...', '/var/www/html/l...', 263, Array)
#1 /var/www/html/app/code/core/Mage/Eav/Model/Config.php(661): Varien_Object->setData(Object(Mage_Catalog_Model_Resource_Eav_Attribute))
...
@fballiano
Copy link
Contributor

like trying to get into a product detail from the product grid?

@sreichel
Copy link
Contributor Author

sreichel commented Sep 3, 2022

Yes. Happens on any grid item ...

@addison74
Copy link
Contributor

Please describe the steps we need to take to confirm the issue.

@fballiano
Copy link
Contributor

auch, yes it happens to me , just go to a product detail mask in the backend

<b>Fatal error</b>:  Uncaught TypeError: Illegal offset type in /Users/fab/Projects/openmage/lib/Varien/Object.php:263
--
  | Stack trace:
  | #0 /Users/fab/Projects/openmage/app/code/core/Mage/Eav/Model/Config.php(661): Varien_Object-&gt;setData(Object(Mage_Catalog_Model_Resource_Eav_Attribute))
  | #1 /Users/fab/Projects/openmage/app/code/core/Mage/Eav/Model/Config.php(480): Mage_Eav_Model_Config-&gt;_createAttribute(Object(Mage_Eav_Model_Entity_Type), Object(Mage_Catalog_Model_Resource_Eav_Attribute))
  | #2 /Users/fab/Projects/openmage/app/code/core/Mage/Eav/Model/Entity/Abstract.php(505): Mage_Eav_Model_Config-&gt;getEntityAttributeCodes(Object(Mage_Eav_Model_Entity_Type), Object(Mage_Catalog_Model_Product))
  | #3 /Users/fab/Projects/openmage/app/code/core/Mage/Eav/Model/Entity/Abstract.php(940): Mage_Eav_Model_Entity_Abstract-&gt;loadAllAttributes(Object(Mage_Catalog_Model_Product))
  | #4 /Users/fab/Projects/openmage/app/code/core/Mage/Catalog/Model/Resource/Abstract.php(743): Mage_Eav_Model_Entity_Abstract-&gt;load(Object(Mage_Catalog_Model_Product), 4, NULL)
  | #5 /Users/fab/Projects/openmage/app/code/core/Mage/Core/Model/Abstract.php(239): Mage_Catalog_Model_Resource_Abstract-&gt;load(Object(Mage_Catalog_Model_Product), 4, NULL)
  | #6 /Users/fab/Projects/openmage/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(93): Mage_Core_Model_Abstract-&gt;load(4)
  | #7 /Users/fab/Projects/openmage/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(239): Mage_Adminhtml_Catalog_ProductController-&gt;_initProduct()
  | #8 /Users/fab/Projects/openmage/app/code/core/Mage/Core/Controller/Varien/Action.php(429): Mage_Adminhtml_Catalog_ProductController-&gt;editAction()
  | #9 /Users/fab/Projects/openmage/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(255): Mage_Core_Controller_Varien_Action-&gt;dispatch('edit')
  | #10 /Users/fab/Projects/openmage/app/code/core/Mage/Core/Controller/Varien/Front.php(190): Mage_Core_Controller_Varien_Router_Standard-&gt;match(Object(Mage_Core_Controller_Request_Http))
  | #11 /Users/fab/Projects/openmage/app/code/core/Mage/Core/Model/App.php(373): Mage_Core_Controller_Varien_Front-&gt;dispatch()
  | #12 /Users/fab/Projects/openmage/app/Mage.php(734): Mage_Core_Model_App-&gt;run(Array)
  | #13 /Users/fab/Projects/openmage/index.php(82): Mage::run('', 'store')
  | #14 {main}

@Flyingmana
Copy link
Contributor

also happens when going through the installer

Warning: Illegal offset type  in /var/www/html/lib/Varien/Object.php on line 263

#0 /var/www/html/lib/Varien/Object.php(263): mageCoreErrorHandler(2, 'Illegal offset ...', '/var/www/html/l...', 263, Array)
#1 /var/www/html/app/code/core/Mage/Eav/Model/Config.php(661): Varien_Object->setData(Object(Mage_Eav_Model_Entity_Attribute))
#2 /var/www/html/app/code/core/Mage/Eav/Model/Config.php(626): Mage_Eav_Model_Config->_createAttribute(Object(Mage_Eav_Model_Entity_Type), Object(Mage_Eav_Model_Entity_Attribute))
#3 /var/www/html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(417): Mage_Eav_Model_Config->loadCollectionAttributes(Object(Mage_Eav_Model_Entity_Type), Array)
#4 /var/www/html/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php(370): Mage_Eav_Model_Entity_Collection_Abstract->addAttributeToSelect(Array)
#5 /var/www/html/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php(337): Mage_Catalog_Model_Resource_Category_Tree->_getDefaultCollection(false)
#6 /var/www/html/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php(131): Mage_Catalog_Model_Resource_Category_Tree->getCollection(false)
#7 /var/www/html/app/code/core/Mage/Catalog/Model/Resource/Category.php(568): Mage_Catalog_Model_Resource_Category_Tree->addCollectionData(NULL, false, '2', true, true)
#8 /var/www/html/app/code/core/Mage/Catalog/Model/Category.php(849): Mage_Catalog_Model_Resource_Category->getCategories('2', 0, false, false, true)
#9 /var/www/html/app/code/core/Mage/Catalog/Helper/Category.php(78): Mage_Catalog_Model_Category->getCategories('2', 0, false, false, true)
#10 /var/www/html/app/code/core/Mage/Catalog/Model/Observer.php(209): Mage_Catalog_Helper_Category->getStoreCategories()
#11 /var/www/html/app/code/core/Mage/Core/Model/App.php(1404): Mage_Catalog_Model_Observer->addCatalogToTopmenuItems(Object(Varien_Event_Observer))

@sreichel
Copy link
Contributor Author

sreichel commented Sep 3, 2022

Please describe the steps we need to take to confirm the issue.

I cant view any item from admin grids ... :(

@sreichel
Copy link
Contributor Author

sreichel commented Sep 3, 2022

Already checked some of the last PRs and reverted, but didnt found it yet ...

@fballiano
Copy link
Contributor

I did this

    public function setData($key, $value=null)
    {
        if (is_array($key)) {
            print_r($key);die();
        }

and it prints

 ```

--
Array
  | (
  | [event] => Varien_Event Object
  | (
  | [_data:protected] => Array
  | (
  | [front] => Mage_Core_Controller_Varien_Front Object
  | (
  | [_data:protected] => Array
  | (
  | )
  |  
  | [_hasDataChanges:protected] =>
  | [_origData:protected] =>
  | [_idFieldName:protected] =>
  | [_isDeleted:protected] =>
  | [_oldFieldsMap:protected] => Array
  | (
  | )
  |  
  | [_syncFieldsMap:protected] => Array
  | (
  | )
  |  


so it's something related to some event/observer?

@addison74
Copy link
Contributor

I confirm the bug in the latest v19. I am not able to edit a product in the Backend. I was able to do it at the beginning of the week. I fetched the upstream two times this week but for testing PRs.

@Flyingmana
Copy link
Contributor

Mage::getSingleton('eav/config')->loadCollectionAttributes($this->getEntity()->getType(), $attribute);

is in the backtrace for me
Mage_Eav_Model_Config->loadCollectionAttributes(Object(Mage_Eav_Model_Entity_Type), Array)

getType should return a string, not an entity

@Flyingmana
Copy link
Contributor

could it be a php 8.1 issue, of not translating the object to a string?

@sreichel
Copy link
Contributor Author

sreichel commented Sep 3, 2022

Yep. illegal offset comes from $this->_data[$key] = $value; where $key is entity.

Same for php7.4/8.1

@fballiano
Copy link
Contributor

same error with php8.0

@Flyingmana
Copy link
Contributor

its not happening on release 19.4.17, can someone compare what arrives there instead in this version?

@sreichel
Copy link
Contributor Author

sreichel commented Sep 3, 2022

Confirm 19.4.17 is okay.

I'm away for next hours till evening :/

@addison74
Copy link
Contributor

I don't think it's PHP8.1, for about two weeks I've been working on XAMPP where I already had PHP8.1 and it works well with Magento Sample Pack. I am pretty sure it is coming from a PR.

I think that the fastest way would be to make a copy of the current installation and then copy directories from the version released at the beginning of August (19.4.17). At least that worked as already confirmed. Once you replace a range of directories just load the window again. Once the problem disappears you identified the directory, then the file/files. That's what I did when the "Any" value was not retained in the grids.

Another method is to revert at a certain period of time. But it is taking more time than the first method.

@Flyingmana
Copy link
Contributor

iam continuing with debug updates in discord (to not further spam this issue here) till I found something final

@fballiano
Copy link
Contributor

problem come from #2524

@Flyingmana
Copy link
Contributor

you know something more in detail, or should we just revert the whole PR?

@fballiano
Copy link
Contributor

im checking it now to see what part of the PR broke it

@fballiano
Copy link
Contributor

(reverting creates conflicts at this stage, for sure it's fixable in some way)

@addison74
Copy link
Contributor

The issues comes from this directory /app/code/core/Mage/Eav. I will search for the file/files.

@fballiano
Copy link
Contributor

this is the problem

Schermata 2022-09-03 alle 09 10 38

@fballiano
Copy link
Contributor

@sreichel I see what you did there heheheh, PR coming

@addison74
Copy link
Contributor

By replacing this file /app/code/core/Mage/Eav/Model/Config.php with the one from v19.4.17 the issue is gone.

@fballiano - good job. You saved my time from looking for the latest changes in this file.

@fballiano
Copy link
Contributor

here you go #2546

@sreichel
Copy link
Contributor Author

sreichel commented Sep 3, 2022

@sreichel I see what you did there heheheh, PR coming

OMG. Sorry.

@fballiano
Copy link
Contributor

don't be, we didn't see the mistake either 😊

A dear friend (who's no longer with us) used to say "only who works makes mistakes" 💪

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

No branches or pull requests

4 participants