Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When importing more than one feature at a time (for example, using drush or features_install_modules()), the node types database might become out of date due to its use of static caching, causing node permissions ("Create $type content", etc.) failing to import. This can be remedied by flushing the node types database before trying to import user permissions.
Comment | File | Size | Author |
---|---|---|---|
#27 | 1187858.27-features.patch | 1.34 KB | mrfelton |
#21 | features-1187858.patch | 1.37 KB | smk-ka |
#17 | features-1187858-17.patch | 1.86 KB | febbraro |
#11 | features_debug.tar_.gz | 2.9 KB | recidive |
#1 | features-user-permissions-1187858.patch | 750 bytes | smk-ka |
Comments
Comment #1
smk-ka CreditAttribution: smk-ka commentedComment #2
febbraro CreditAttribution: febbraro commentedComment #3
recidive CreditAttribution: recidive commented#1265168: Rebuild the file list properly when a feature is enabled or disabled has more information than this one. This problem affects all entities, not just nodes, and it's related to a module adding a permission that has to do with an entity instantiated in other module.
Comment #4
recidive CreditAttribution: recidive commentedHey guys, can we do a sprint to get this fixed. I'm stuck on this issue for 3 weeks now. Need to get this sorted out in order to move my install profile forward.
Comment #5
febbraro CreditAttribution: febbraro commentedDoes the patch in #1 fix it for you?
Comment #6
febbraro CreditAttribution: febbraro commentedAlso, the best way to get this fixed in your time frame is to debug it and fix it and post a patch which we can review and commit. Also, with your patch, if you can provide more detail so that folks can have a specific test case and a patch to verify.
Comment #7
recidive CreditAttribution: recidive commented@febbraro, no patch in #1 doesn't fix the problem.
I'm debugging this for 3 weeks now, have tried changing things in a myriad of ways. I'm looking forward to have a patch to send. But can't find where the problem is. I'm sure it's related to installing using drush si/aegir, since the problem doesn't occur when using the installer (install.php).
I'm looking for some guidance from Features experts so I can look for the problem in the correct place.
I'm pretty sure this issue is the same as in #1063204: Adding a new permission causes integrity constraint violation. I'll try latest dev code now that #1195432: Use dependency information when importing got committed.
Comment #8
recidive CreditAttribution: recidive commented#1195432: Use dependency information when importing doesn't fix the problem. Can we mark this issue duplicate of #1063204: Adding a new permission causes integrity constraint violation?
Comment #9
smk-ka CreditAttribution: smk-ka commented#1195432: Use dependency information when importing shouldn't be related, as it only helps with dependencies on module level (i.e., those in .info files). What you are describing sounds more like a dependency issue related to feature *components*, i.e. to my knowledge there isn't a way to tell features to first import the taxonomy vocabularies, which are required later down the pipeline when importing user permissions. You could try adding
echo 1;
at the top oftaxonomy_features_rebuild()
function, andecho 2;
at the top ofuser_permission_features_rebuild()
to see in which order they're actually executed. This would help to find out whether it's an execution order issue, or a caching issue.And yes, we need to be able to reproduce this issue. From the various issues at hand (esp. #1265168-1: Rebuild the file list properly when a feature is enabled or disabled) it seems like we have to
drush si features_debug --uri=http://default --db-url=mysql://user:pass@localhost/dbname
Comment #10
recidive CreditAttribution: recidive commented@smk-ka: thanks! Yes, I'm going to create an install profile to help reproduce the problem.
Comment #11
recidive CreditAttribution: recidive commentedOk, I've created an install profile, starting from a copy of minimal, to help reproduce the problem.
I added a feature module that creates an user role a taxonomy vocabulary and set permissions for administrating, adding and deleting terms to the vocabulary.
Here are the errors that occur when installing a new site using this profile:
Note: the
Missing argument 1 for features_enable()
error was introduced in latest commits made in Features module, this was not happening few weeks ago.To reproduce the issue:
Comment #12
recidive CreditAttribution: recidive commentedConfirmed, installing through install.php installer works fine.
Comment #13
febbraro CreditAttribution: febbraro commentedThe difference b/w a drush si and install.php is that install.php uses the batch api for the modules installs so it must be a cache thing I'm thinking....
Comment #14
recidive CreditAttribution: recidive commented@febbraro: makes sense. Is there anything I can try?
Since the issue is assigned to yourself, can I assume you're looking at fixing this problem?
Thanks!
Comment #15
febbraro CreditAttribution: febbraro commentedComment #16
febbraro CreditAttribution: febbraro commentedI just ran through your install profile exactly as you detailed in #11 and everything installed cleanly without errors.
Comment #17
febbraro CreditAttribution: febbraro commented@recidive I ran through and think I reliably reproduced your error. Can you try the attached patch and let me know if this fixes your problem?
Comment #18
febbraro CreditAttribution: febbraro commented@smk-ka: committed your patch in #1 to 7.x branch. http://drupalcode.org/project/features.git/commit/b82b16d
Comment #19
febbraro CreditAttribution: febbraro commentedAlso committed patch in #17 as it was a regression from an earlier patch.
Going to close this and move recidive's problem to another issue.
Comment #20
attiks CreditAttribution: attiks commentedFYI I just tested with latest dev version with recidive's test module in #11 and it's working, also backlinking to #1265168: Rebuild the file list properly when a feature is enabled or disabled
Comment #21
smk-ka CreditAttribution: smk-ka commentedHm, I had to clear the static caches altogether to be able to install cleanly. Attached patch is IMO the most robust solution. And thanks for the install profile, @febbraro!
Comment #22
febbraro CreditAttribution: febbraro commented@smk-ka you had to remove all static caches to install the profile from #11 cleanly? I did not have to do that for a clean install.
@recidive, does this patch help you with your other profile problem?
Comment #23
recidive CreditAttribution: recidive commented@attiks: thanks, I forgot to say that was working in my comment.
@smk-ka: I tested your patch in #21, and the MartPlug install completes but with some warnings and I get a broken install with errors and missing stuff. Any clues?
Comment #24
smk-ka CreditAttribution: smk-ka commented@febbraro Yes, without clearing all static caches, drush outputs the following notices (may need to use verbose output –
-v
option):@recidive I know those errors from my own features, but wouldn't say they're related to this one, so better create a new issue.
Comment #25
recidive CreditAttribution: recidive commented@smk-ka: I wonder if we should move this issue to drush queue, It looks like we are trying to do something impossible here.
Comment #26
mrfelton CreditAttribution: mrfelton commentedThe patch in #21 resolved my issue in #1357262: Unable to include feature that contains a bean type in an installation profile which seems to be related #1063204: Adding a new permission causes integrity constraint violation.
Comment #27
mrfelton CreditAttribution: mrfelton commentedPatch from #21 is the only things that gets things (semi) working for me at the moment. This version (which is exactly the same) applies cleanly against 7.x-1.x using drush make.
Comment #28
smk-ka CreditAttribution: smk-ka commentedJust a heads-up: while this patch fixes the node permissions import, it introduces a new bug, which results in the features admin UI to appear unstyled (or at least with some styles missing). This happens due to calling
drupal_static_reset()
without argument clearing out all statically cached CSS files that have been added on the page so far. However, I wasn't able to find the static caches that actually need to be cleared, therefore I can't offer a better solution ATM.Comment #29
mrfelton CreditAttribution: mrfelton commented@smk-ka - I can confirm that. My Features UI page, as well as /admin/modules are completely unthemed.
Comment #30
neochief CreditAttribution: neochief commentedI'm marking this as duplicate in favor of #1265168: Rebuild the file list properly when a feature is enabled or disabled (patch in #20)
Please reopen this issue if that patch doesn't solve issue for you.
Comment #31
agalitsyn CreditAttribution: agalitsyn commentedConfirmed #28. Patch from #27 brokes features page in BO.
delete drupal_static_reset() from function user_permission_features_export_render
Comment #32
drewish CreditAttribution: drewish commented#1063204: Adding a new permission causes integrity constraint violation seems to be where this is going.
Comment #33
drewish CreditAttribution: drewish commented#1063204: Adding a new permission causes integrity constraint violation seems to be where this is going.