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.
Following on the patches in https://drupal.org/node/2220575 for inspiration I discovered that there is another point in the code path that triggers the same issue.
The function og_get_groups_by_user is called by several other functions in a single page load on the site I was testing with.
This patch utilizes the same functionality and idea as the one listed above to reduce entity_load() calls for og_membership relations.
Comment | File | Size | Author |
---|---|---|---|
#20 | structure.jpg | 58.82 KB | iamjon |
#17 | 2247557-avoid-entity-load-issue-13.patch | 804 bytes | iamjon |
#12 | 2247557-avoid-entity-load-issue-12.patch | 793 bytes | Devin Carlson |
#10 | 2247557-avoid-entity-load-issue-3.patch | 465 bytes | codexmas |
Comments
Comment #1
codexmas CreditAttribution: codexmas commentedComment #2
japerryAwesome work Gord! Marking needs review, I'll add it to my list of patches to test against commons =)
Comment #4
codexmas CreditAttribution: codexmas commentedComment #5
codexmas CreditAttribution: codexmas commentedComment #7
codexmas CreditAttribution: codexmas commentedComment #8
codexmas CreditAttribution: codexmas commentedComment #10
codexmas CreditAttribution: codexmas commentedTesting baseline
Comment #11
Devin Carlson CreditAttribution: Devin Carlson commented7: 2247557-avoid-entity-load-issue-2.patch queued for re-testing.
Comment #12
Devin Carlson CreditAttribution: Devin Carlson commentedAn updated version of #7 to address the errors.
Comment #14
ezra-g CreditAttribution: ezra-g commentedLooks #12 passed testing, despite the erroneous comment in #12.
Comment #15
amitaibu@ezra-g, I didn't understand your comment from #14 -- is the patch working for you?
Comment #16
joachim CreditAttribution: joachim commentedThis change looks wrong. We can't see in the patch what happens to $gids later, but its structure appears to have changed.
Comment #17
iamjon CreditAttribution: iamjon commentedI applied the patch but unfortunately I noticed the calls to entity load actually increased. From 17,981 to 34,387
Also following what joachim mentioned I changed the patch to
But that threw out an error:
Warning: Illegal offset type in og_get_groups_by_user() (line 3551 of /home/phpteam/www/mythingsdev/mythings/modules/contrib/og/og.module).
However entity_load dropped drastically to 202 calls from 17,981.
Attaching a patch if anyone wants to investigate further
Comment #18
iamjon CreditAttribution: iamjon commentedChanging status
Comment #20
iamjon CreditAttribution: iamjon commentedI double checked. Patch #12 does not change the structure as per comment 16.
the structure stays the same
dpming $gids revels that $gids looks like
The patch unfortunately does not lower the entity_load calls.