Closed (fixed)
Project:
State Machine
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2019 at 11:02 UTC
Updated:
21 Nov 2019 at 11:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dimilias commentedComment #3
dimilias commentedI do not know how the test was merged in https://www.drupal.org/project/state_machine/issues/3012285 since the source of the issue seems to be due to core since 8.0.
The failing test derives from the fact that the view itself is not imported but it does not throw any errors. Digging a bit more on what happens when a module is installed, it seems the process ends up in
\Drupal\Core\Config\ConfigInstaller::createConfigurationwhere it loads the appropriate Entity class from the configuration file and attempts to create and store an entity with the given values.That leads to line 363 of that file where it is checked if the entity is installable (
if ($entity->isInstallable()) {).For a view entity, the
\Drupal\views\Entity\View::isInstallableis gathering the views data from all entities and checks if the base table declared in the view exists.So the main problem is the main table. For the
StateTransitionFormTest, theEntityTestWithBundletest content entity is used.This entity, in its definition PHPDocBlock has the following:
The
translatablehere is very important as, during the construction of the views data, there is a distinction between thebase_tableanddata_table.In
\Drupal\views\EntityViewsData::getViewsData, the following check is performedwhich overrides the base table with the data table, which means that the base table for the views is not
entity_test_with_bundlebutentity_test_with_bundle_field_data.The same applies for all base properties in the view. So the label requested should be
(the table of the property should also point on the data table).
This also is consistent with the rest of the translatable entities, like node, where I exported a single view and it contains
I am attaching a patch to fix the views and allow the tests to be green again as the patches fail all over. Again, How was this merged if it was not tested? Accident?
Comment #4
dimilias commentedComment #5
dimilias commentedSorry, empty patch provided before. I accidentally created it without committing the changes so it was blank. Providing the correct patch now.
Comment #6
alonaoneill commentedPatch applied!
Not sure what was wrong before.
Comment #7
neograph734EntityTestWithBundle was changed 2 months ago in https://git.drupalcode.org/project/drupal/commit/46424a8
Comment #8
jungleConfirm that tests passed on my local
Comment #10
bojanz commentedCommitted, thanks!