The Deploy UI throws some exceptions when exporting revision-enabled entity types with the ViewsAggregator as that one does not even return the revision id property.
The attached patch resolves that issue by adding some checks in place but it should eventually probably be fixed by fixing ViewsAggregator.
I might be missing something though... (No spare time atm. to dig deeper :/).
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | deploy-views_missing_revision_id-2196109-16.patch | 2.52 KB | fmizzell |
| #8 | deploy-views_missing_revision_id-2196109-8.patch | 2.85 KB | grasmash |
| #7 | deploy-views_missing_revision_id-2196109-7.patch | 2.39 KB | grasmash |
| #3 | deploy-views_missing_revision_id-2196109-2.patch | 1.38 KB | timaholt |
| #1 | 2196109-1.patch | 1.39 KB | fubhy |
Comments
Comment #1
fubhy commentedComment #2
dixon_Thanks fubhy! :) Comitted to 7.x-2.x!
Comment #3
timaholt commentedJust to reiterate the first patch is definitely a band-aid solution. Here's a patch to actually fix the views aggregator to provide the revisions from the aggregator.
Comment #4
timaholt commentedComment #5
fubhy commentedYep, totally a band-aid solution. Had no time to dig deeper or provide a full fix. Thanks for jumping in!
That brings the notices back if I am not mistaken. We need to check if revisions are actually supported. 'revision' entity key might not even be set.
Comment #6
dixon_I did a blind commit with Tim's patch in #3 (I'm not in a position to test it right now) so I will leave this issue open so we can iterate on it and potentially fix the notices that may arise from missing revision keys.
Comment #7
grasmash commentedI've refactored Tim's changes by moving a couple of lines out side of the loop, and accommodating the edge case where the entity type doesn't support revisions. I've also rolled changes from #2204101: Pass contextual filter values to Views Aggregator into this patch, given that both issues modify the same hunk and cannot be applied separately--sorry to conflate the issues.
Comment #8
grasmash commentedForgot the form element.
Comment #9
timaholt commentedMatt thanks for adding/refactoring. I will take a look at this patch. Also @fuhby good catch, but looks like matt beat me to fixing that.
Comment #10
hnln commentedThis patch causes fatal errors on feature page if you use a view for entities without revision (I'm using it for eck entities). So revision integration should check if the is actually revision info.
Comment #11
fmizzell commented@HnLn could you be a little more specific on how you are getting to the fatal error? Here is what I did trying to reproduce your problem:
Maybe I am completely misunderstanding your problem, but a little more info will be helpful :)
Comment #12
fmizzell commentedThis patch fixes a warning occurring when the views aggregator is being configured during a plan's creation.
Comment #13
Anonymous (not verified) commentedI applied the patch in #8 and it works for me.
What I did: created some file entities through the media module, add those to a feature, deleted the files and reverted the feature. Files were back in place as expected.
EDIT: Some weird stuff happened because we both posted at the same time here, I did not delete any patches like the post claims.
Comment #14
hnln commented@fmizzell
Tnx for following up on this, it might be my local setup, it's rather complex content (lots of entity references several levels deep).
If I switch from deploy stable to the latest dev I get this error when I do a drush cc all or go to the features page:
PHP Fatal error: Cannot access empty property in sites/all/modules/contrib/deploy/modules/deploy_aggregator_views/plugins/DeployAggregatorViews.inc on line 49
If I change line 49 from
$entities[] = array('type' => $entity_type, 'id' => $entity_id, 'revision_id' => $entity[$entity_id]->$revision_key)to
$entities[] = array('type' => $entity_type, 'id' => $entity_id);The errors go away. It looks like an extra check is needed here to see if revision id is available ?
Comment #15
hnln commentedOK, I did miss that there were patches available :-) So my comment is mainly to point out that the current dev version is broken for entities without revisions. Applying the 12/13 patch also fixes the issue.
Comment #16
fmizzell commentedThe same patch from 12 without style issues.
Comment #20
john-m-adams commentedIt appears that there has been a recent commit on this issue, so I wanted to make sure that patch from #16 is still relevant/required for entities without revisions.
I am receiving the same fatal error as HnLn reported in #14, on 7.x-3.0-alpha1
Comment #21
pawel_r commentedPatch from #16 worked for me.