Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
Issue 2: undifiened method getDefaultAttributes() for invoice, creditmemo, ... fixed arround line 372
Related Pull Requests
See OpenMage/magento-lts#2993
Fixed Issues (if relevant)
See OpenMage/magento-lts#4034
Manual testing scenarios (*)
install n98/magerun:dev-develop (v3.0.0)
add custom attributes to all entity types
Test script
```php
'text', 'input' => 'text', 'label' => 'Test Attribute'];
foreach (self::entityTypeProvider() as $entityType) {
$this->createAttribute(array_values($entityType)[0], $attributeCode, $data);
}
}
/**
* From N98-magerun unit test
*/
public static function entityTypeProvider()
{
return [['catalog_category'], ['catalog_product'], ['creditmemo'], ['customer'], ['customer_address'], ['invoice'], ['order'], ['shipment']];
}
/**
* From N98-magerun unit test
*
* @param string $entityType
* @param string $attributeCode
* @param array $data
*/
protected function createAttribute($entityType, $attributeCode, $data)
{
$setup = Mage::getModel('eav/entity_setup', 'core_setup');
$setup->addAttribute($entityType, $attributeCode, $data);
}
}
$test = new Test4034();
$test->prepare();
```
test eav:attribute:view creditmemo crazyCoolAttribute and eav:attribute:remove creditmemo crazyCoolAttribute
Questions or comments
After adding/removing EAV cache has to be cleaned, but this should be done in N98-magerun. (???) Not sure if it fixes all errors in unit tests, but these two issues should be easy to reproduce.
Description (*)
Issue 1:
array_keys(null)
fixed arround line 573.Issue 2: undifiened method
getDefaultAttributes()
for invoice, creditmemo, ... fixed arround line 372Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
n98/magerun:dev-develop
(v3.0.0)Test script
```php 'text', 'input' => 'text', 'label' => 'Test Attribute']; foreach (self::entityTypeProvider() as $entityType) { $this->createAttribute(array_values($entityType)[0], $attributeCode, $data); } } /** * From N98-magerun unit test */ public static function entityTypeProvider() { return [['catalog_category'], ['catalog_product'], ['creditmemo'], ['customer'], ['customer_address'], ['invoice'], ['order'], ['shipment']]; } /** * From N98-magerun unit test * * @param string $entityType * @param string $attributeCode * @param array $data */ protected function createAttribute($entityType, $attributeCode, $data) { $setup = Mage::getModel('eav/entity_setup', 'core_setup'); $setup->addAttribute($entityType, $attributeCode, $data); } } $test = new Test4034(); $test->prepare(); ```eav:attribute:view creditmemo crazyCoolAttribute
andeav:attribute:remove creditmemo crazyCoolAttribute
Questions or comments
After adding/removing EAV cache has to be cleaned, but this should be done in N98-magerun. (???) Not sure if it fixes all errors in unit tests, but these two issues should be easy to reproduce.
Todo: add
Mage::app()->getCacheInstance()->cleanType('eav');