Closed argiepiano closed 1 year ago
OK, the issue here is that there is a OG class that extends EntityDefaultExtraFieldsController
. Apparently this class is needed right away, before Backdrop has had the opportunity to enable E+ in the upgrade process. It's unclear to me what the solution might be.
A quick solution is to always enable the stub D7 entity_plus
module in the D7 site before attempting the upgrade.
OK, I've found the culprit. The class OgMembershipViewsController
, which extends Entity Plus' EntityDefaultExtraFieldsController
, is defined in og.views.inc
. This file is included early during the upgrade process, way before Entity Plus is enabled.
To clarify, this class is not needed at this stage - it just happens to be present in a file that includes other functions that are needed at that moment. The problem is that, when you include a file that contains classes, PHP will verify that the parent classes exist (which they don't since Entity Plus is not enabled yet).
The solution is to move this class to its own file, and to include this file in the og_autoload_info()
. This way PHP will not throw a fatal error, and the class is indeed found when needed. I've tested this solution and it works well. PR coming.
(BTW this class is a utility class that allows Entity Plus to create views fields for the fields provided by OG).
PR #139.
To test:
entity_plus
We have a test failure not related to this PR. It looks like one of the tests is trying to install or include the contrib entityreference instead of using the core version?
Test failure fixed - it was produced by entityreference_prepopulate
. Ready for testing!
I'm not able to test at the moment but it looks good to me, makes sense, and given your extensive testing and the relatively minor change (moving code and changing the location in the autoload) I'd be comfortable with it being merged. Great job!
When upgrading from D7 WITHOUT first installing the D7
entity_plus
stub module you get a fatal errorError: Class 'EntityPlusDefaultViewsController' not found
.This is happening even though Entity Plus is present in the modules folder, and it is being enabled during the update process (see https://github.com/backdrop/backdrop-issues/issues/5499, which added this feature to Backdrop's core).
It's unclear to me why this is happening. I tried adding the class to E+'s autoload function, but that doesn't make any difference.
BTW, if you try the upgrade again after the failure, it works the second time around. Step-debug is needed to see what's going on.