Arty
Well-known member
- Affected version
- 2.0.0 DP 10
This is sample code from setup:
There is also entity class that adds test field to entity.
After that code is ran, styles list in registry doesn't contain "test" column, so using this code to get list of styles:
doesn't return 'test' column.
I think problem is caused by this code in XF\Repository\Style:
It immediately rebuilds styles list, before style entity is extended, therefore entity doesn't contain "test" field. It should be ran after add-on installation is complete and classes are extended.
Code:
public function installStep1()
{
$this->schemaManager()->alterTable('xf_style', function(Alter $table)
{
$table->addColumn('test', 'tinyint')->setDefault(0);
});
\XF::repository('XF:Style')->triggerStyleDataRebuild();
}
After that code is ran, styles list in registry doesn't contain "test" column, so using this code to get list of styles:
Code:
$styles = \XF::registry()->get('styles');
I think problem is caused by this code in XF\Repository\Style:
Code:
public function triggerStyleDataRebuild()
{
$this->app()->service('XF:Style\Rebuild')->rebuildFullParentList();