In handlers.inc, views checks for class existence for its handlers by using class_exists() with only one parameter.

On sites with autoload implementations like autoload.module, this causes theses implementations to trigger uselessly since loading is controlled by Views itself, causing extra load. The second parameter should therefore be passed as FALSE to avoid triggering autoload. This happens in _views_create_handler, views_include_handler, and views_get_table_join.

CommentFileSizeAuthor
#7 1212660_0.patch2.83 KBdawehner
#4 1212660.patch3.46 KBdawehner
#2 1212660.patch1.89 KBdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Interesting. This is only true for 6.x since in 7.x we actually let core's autoload handle this, but for 6.x I agree that we can use that class_exists flag.

dawehner’s picture

Status: Active » Needs review
FileSize
1.89 KB

Here is a patch which replaces each instance.

fgm’s picture

What I did not check was whether there were other places where this could happen: there are other occurrences of class_exists without this flag in views_handler_relationship.inc and views_handler_relationship_translation.inc and I think they also should have it.

dawehner’s picture

FileSize
3.46 KB

Here is a new version of the patch.
This should have all places fixed.

fgm’s picture

I notice that the latest patch also changes the regex for the display_id by removing uppercase letters. Even if necessary, this does not seem to be related ?

dawehner’s picture

Status: Needs review » Needs work

Oh yes, this was part of another patch.

dawehner’s picture

Status: Needs work » Needs review
FileSize
2.83 KB

Here is the last patch without the regex.

fgm’s picture

Status: Needs review » Reviewed & tested by the community

Good for me.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed to 6.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.