If a class begins with an underscore, this can currently crash the class loader.
In particular, it will crash xautoload_ClassFinder_Helper_Map::findFile_map().

I am sure we can fix this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

clivelinsell’s picture

This is currently causing a problem using XAutoload with the Crumbs module (http://drupal.org/project/crumbs)

Any news on a fix? I'd be happy to provide a patch myself if you can point me in the right direction...

Thanks

donquixote’s picture

Hi!
I am currently traveling, so don't have that much time to look into this.

I know that I fixed the bug somewhere locally, and it was not that hard.. but I don't know where to find it atm :(

The places to look would be
lib/ClassFinder/Prefix.php
lib/ClassFinder/NamespaceOrPrefix.php
each in the findFile() method.

I think what I did was to totally block class loading if the first character is an underscore.
But instead you could say that the underscore will be part of the first fragment..

Could you try this patch?

donquixote’s picture

Status: Active » Needs review

..

clivelinsell’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #2 has done the trick, thank you very much :)

donquixote’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in 7.x-3.1

donquixote’s picture

Category: task » bug

To be fair, this was a bug. Not a task.

donquixote’s picture

Status: Fixed » Needs review

Just enabled the automated testing for issues.. let's try if this works :)

donquixote’s picture

Status: Needs review » Fixed

And of course it is still fixed.

Status: Fixed » Closed (fixed)

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