Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ezra-g’s picture

Here's one stopgap patch that implements equivalent changes in Views and a second that uses the new API function defined in #106721: Optimize node access query building.

msonnabaum’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

msonnabaum’s picture

Status: Reviewed & tested by the community » Needs review

To be clear, I'm RTBC-ing 2204257-views-content-access-filter-core-1-stopgap.patch.

msonnabaum’s picture

Status: Needs review » Reviewed & tested by the community

Oops.

andyg5000’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
988 bytes

The first patch in #1 calls an undefined method static::buildGrantsQueryCondition (D8?). Here's a patch to apply the same update but call node_add_node_grants_to_query() instaead.

weri’s picture

joelpittet’s picture

Status: Needs review » Needs work

@andyg5000 where is node_add_node_grants_to_query? I don't see that function in core.

joelpittet’s picture

Status: Needs work » Needs review

Sorry, didn't realize it was in the IS referenced patch.

ohthehugemanatee’s picture

Status: Needs review » Reviewed & tested by the community

This patch (#5) has been in production in Drupal Commons for a long time now. Marking this as RTBC.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thank you! Its great to see this in the wild since a while already

  • dawehner committed d649d32 on 7.x-3.x authored by andyg5000
    Issue #2204257 by ezra-g, andyg5000: Update Views Content access filter...
jastraat’s picture

It doesn't look like node_add_node_grants_to_query() is in core yet; the patch from #106721: Optimize node access query building doesn't appear to have been committed to core.

Another individual opened #2608652: Call to undefined function node_add_node_grants_to_query() since upgrade. This probably should not have been added to views until the core patch was accepted and released in an official version.

kristofferwiklund’s picture

Priority: Normal » Major
Status: Fixed » Needs work

This patch is not working with latest Drupal core as stated above.

andyg5000’s picture

The patch in this issue is dependent on #106721: Optimize node access query building as stated in the issue summary. Looks like this commit should be reverted until that issue is closed out.

maximpodorov’s picture

Priority: Major » Critical

This should be reverted immediately, and new release should be created. Please don't break our sites.

dawehner’s picture

Priority: Critical » Normal

I'm sorry about the misery.
This is the entire problem space with this "its RTBC just commit it" ... its never easy.

Back to normal to add a fix until #106721 is done.

dawehner’s picture

Created a new release which should be there in a while.

  • dawehner committed 5c2bfc9 on 7.x-3.x
    Revert "Issue #2204257 by ezra-g, andyg5000: Update Views Content access...
colan’s picture

Status: Needs work » Postponed

We need to wait for the core issue to get in.

bcooksley’s picture

Can we please be more careful in future with releases? As a sysadmin, getting pelted with countless emails from numerous Drupal instances informing me that there is yet another update to a rather commonly used module is getting a little annoying - especially when I was sure I had updated that module already this week.

joelpittet’s picture

@bcooksley You can help write tests or fix the testbot to ensure This won't happen.

They are all volunteering to maintain the module. Maybe instead of complaining you could pitch in.

Colon's got some issues up that could use help tracking down some testbot test failures which arose I think when they were moving away from pifr.

gifad’s picture

Just looking at the patches, the inserted line :
$grants = node_add_node_grants_to_query(node_access_grants('view'));
should be :
$grants = node_add_node_grants_to_query(node_access_grants('view'), $table);
or am I missing something ?

DamienMcKenna’s picture

Also, once the core issue is committed should the dependencies b updated to require the newest version to avoid the problems that happened with the 7.x-3.12 release?

@gifad: The patch's docs say the second argument is optional, is there a specific need to include it?

gifad’s picture

@DamienMcKenna : I ping you back the question : was there a specific need to prefix gid and realm by table name, in the "old" code ?

colan’s picture

Follow-up to #21: For those of you interested in getting testing up & running again (to avoid the kind of problem above), please help with #2610292: 7.x-3.x-dev failure: testStaticAccessPlugin.

@DamienMcKenna: Good catch! Yes, we should update the dependencies.

helmo’s picture

What about adding it with a function_exists check?

Even if #106721: Optimize node access query building gets into 7.42 and views gets a new release after that there still is a big potential for WTF experiences.
Unless it would be made impossible to use the new views with an older version of core.

Status: Needs review » Needs work

The last submitted patch, 26: update_views_content-2204257-26.patch, failed testing.

helmo’s picture

Status: Needs work » Needs review

test hickup?

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

Patch 26 looks safest, I agree with @helmo, because we cannot guarantee a core upgrade at the same time as a views upgrade.
Patch 26 will work either way.

we should push for the D7 core performance improvement here:
#106721: Optimize node access query building

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 26: update_views_content-2204257-26.patch, failed testing. View results

fenstrat’s picture

Status: Needs work » Needs review
FileSize
1.24 KB

Reroll of #26.