Fixed \XF\Api\Docs\ClassParser :: parseEntityClass fails if class name contains /

DragonByte Tech

Well-known member
Affected version
2.1.0 RC2
F.ex. xf-dev:generate-api-docs DBTech/eCommerce --renderer=xf2Html -> result: "Class DBTech/eCommerce\Entity\ShippingCombination does not exist"
Using DBTech\eCommerce results in an empty $this->types array in XF\Api\Docs\Compiler.

Fix: in ClassParser find $className = \XF::stringToClass($shortName, '%s\Entity\%s'); add above $shortName = str_replace('/', '\\', $shortName);
 
I didn't do the fix in this method as at this point, we are assuming a proper short name (which does require a backslash), but I have made changes to the calling code which expects an add-on ID.
 
Back
Top Bottom