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.
This bug is triggered by the query ran by the components in the implementations of hook_features_export_options(), when the query returns a large number of objects (files, nodes, terms), in my case more than 100 000 nodes. The options array parsed for the feature create form becomes huge and Drupal quickly runs into allowed memory size exhausted error.
My suggestion is to create an administration screen for UUID Features and expose options/limits/filters on object selection queries from the implementations of hook_features_export_options(). Any thoughts?
Comment | File | Size | Author |
---|---|---|---|
#13 | uuid_features-1719414-13.patch | 7.81 KB | saltednut |
#13 | uuid_features_test-7.x-1.0-beta1.tgz | 43 KB | saltednut |
#13 | interdiff.txt | 9.06 KB | saltednut |
#8 | uuid_features-1719414-8.patch | 3.38 KB | steve.elkins |
#6 | uuid_features-1719414-6.patch | 4.41 KB | happysnowmantech |
Comments
Comment #1
jgraham CreditAttribution: jgraham commentedJust ran into this on a site here. I would suggest a two-route way to resolve this. The below approach only focuses on nodes, but should be similarly and appropriately applied elsewhere.
Attached patch implements the above described approach for nodes.
Comment #2
jgraham CreditAttribution: jgraham commentedComment #3
jgraham CreditAttribution: jgraham commentedSame patch as 2, but with titles for admin settings page.
Comment #4
jgraham CreditAttribution: jgraham commentedUpdated patch from 3 adjusted to use taxonomy machine names rather than vids so that this is features safe for exporting via strongarm.
Comment #5
jgraham CreditAttribution: jgraham commentedOy, sorry for the issue spam. Missed a call to taxonomy_get_vocabularies() in uuid_features_admin().
Comment #6
happysnowmantech CreditAttribution: happysnowmantech commentedI encountered this problem too. I re-rolled the patch in #5 with a few fixes (implement hook_permission() and also check if any node types or vocabularies are actually selected). As far as I can tell, though, it still doesn't solve the problem of being able to use UUID feature integration with node types that have a large number of nodes, my website still runs out of memory.
Comment #7
Jeffrey C. CreditAttribution: Jeffrey C. commentedAdding the tag.
Comment #8
steve.elkins CreditAttribution: steve.elkins commentedHere's another patch borrowing from #6 for the latest 7.x-1.x-dev. Had to rearrange a bit to account for the changes introduced by #1904946: Nodes should be able to export file fields and #1893914: Taxonomy terms should be able to export file fields.
Comment #9
askibinski CreditAttribution: askibinski commentedPatch at #8 works nice with latest -dev, thanks.
However I agree with #6 that this patch doesn't really solve the problem. If you would have 1 content-type selected which has a lot of nodes, memory limits will occur.
The 'drupal-way' to fix this would be an autocomplete field instead of checkboxes for each node. (maybe showing an autocomplete if more than > 100 nodes or something). But I don't know if features allows for this kind of UI. And also, an autocomplete is not the most user friendly thing on earth.
Comment #10
askibinski CreditAttribution: askibinski commentedrelated:
#1626360: Features UI becomes unusable with large number of nodes
Comment #11
saltednutComment #12
saltednut#8: uuid_features-1719414-8.patch queued for re-testing.
Comment #13
saltednutI think this is a problem with the Features UI. Features 2.0 should be better about this and also lazy-load the checkboxes but it doesn't.
This patch you guys have been working on is really great because it at least gives us control to prevent specific node bundles from destroying Features admin screens.
I think that anything further than this is a problem that Features UI should handle. They have a few options - maybe lazy loading checkboxes in JS or they could provide pagers. I'm not a UX expert but thats my advice for them. Features still needs to know what to do when a call for 3,000 checkboxes is made.
Because they don't do this for us, we cant assume the act of UUID Features Integration attempting to provide exportables for all the nodes on your site is always safe.
So, I think it should be turned off by default. This patch adjusts the new settings so that the particular bundle must first be turned on in at admin/config/content/uuid_features order to make uuid_features expose them to Features.
Some other additional changes added here:
Adding this twice was unnecessary so I rewrote it in a way that could support our uuid_entity types.
I decided to introduce hook_entity_info_alter as well so that we can keep easier track of what entities uuid_features support - I then used that information to build the settings form.
The next thing I realized though is that beans didn't yet support file field exports (though they easily could) so I went ahead and added that too just so this would completely work.
Comment #14
saltednut#13: uuid_features-1719414-13.patch queued for re-testing.
Comment #15
paolomainardi CreditAttribution: paolomainardi commentedThis patch works as expected, but i have some strange warnings when i use drush cc:
Comment #16
joseph.olstadNo problems with 'drush cc' in my environment using a rollup patch on the latest 7-1.x dev build as of dec 4, 2013.
The report of the "drush cc" issue is unconfirmed. I applied the patches and ran "drush cc all"
'all' cache was cleared in /path/vhost#default [success]
see: https://drupal.org/node/2149949
Comment #17
joseph.olstadsee: solve uuid hangs on too many nodes - multiple patch rollup on dec 4 dev build
#2149949: Multiple Patches need to be committed to UUID Features and have been rolled into one.
Comment #18
saltednutThanks for working on this. BTW, you can use brackets to link to issues to save yourself some time.
#2149949: Multiple Patches need to be committed to UUID Features and have been rolled into one.
Comment #19
joseph.olstadComment #20
joseph.olstadSummary howto
for others who want to test this #2149949: Multiple Patches need to be committed to UUID Features and have been rolled into one.
test scenario:
This patch adds the following functionality
Howto
Expected results:
Comment #21
saltednutThis was broken into two issues. Let's just close this one and continue on the other one since that is where the latest patch is.
#2149949: Multiple Patches need to be committed to UUID Features and have been rolled into one.