Not a bug xf-dev:generate-finders does not add the suffix "Finder" to finder classes

Xon

Well-known member
Affected version
2.3.2
I've just ran xf-dev:generate-finders for an XF2.3 only add-on and it doesn't follow XF's conversion of adding Finder to the end of the classname.

That said this, that name change isn't backwards compatible with XF2.2 which is annoying
 
GenerateFinders was updated but it is XF's own class aliases which is the problem.

The problem is this line:
PHP:
if (!class_exists($fqFinderClass))

Replacing with:
PHP:
$contents = (string)@file_get_contents($fileName);
if ($contents === '' || !class_exists($fqFinderClass))

and removing the later file_get_contents in the code, should work
 
The class existence check ensures we don't generate a finder if one already exists, regardless of whether it uses the suffix or not. As of RC5 it should generate them with the suffix, and it seems to work okay for me.
 
Back
Top Bottom