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.
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
.
Comment | File | Size | Author |
---|---|---|---|
#7 | 1212660_0.patch | 2.83 KB | dawehner |
#4 | 1212660.patch | 3.46 KB | dawehner |
#2 | 1212660.patch | 1.89 KB | dawehner |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedInteresting. 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.
Comment #2
dawehnerHere is a patch which replaces each instance.
Comment #3
fgmWhat 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.
Comment #4
dawehnerHere is a new version of the patch.
This should have all places fixed.
Comment #5
fgmI 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 ?
Comment #6
dawehnerOh yes, this was part of another patch.
Comment #7
dawehnerHere is the last patch without the regex.
Comment #8
fgmGood for me.
Comment #9
dawehnerThanks, committed to 6.x-3.x