Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 1.0
-
Fix Version/s: None
-
Component/s: Technical infrastructure
-
Labels:None
Description
When an inherited class refers to a constant defined by one of its ancestors by 'self::FOO', the php5 to php4 converter incorrectly translates the name.
For instance, CRM_Import_Parser defines a constant VALID, a reference to "self::VALID" in CRM_Import_Parser_Contact should be translated to "CRM_IMPORT_PARSER_VALID", but instead becomes "CRM_IMPORT_PARSER_CONTACT_VALID".
Similarly, using "parent::FOO" simply translates to "PARENT_FOO".
One workaround is to always refer to constants using explicit class names. This is a good enough fix, but it would be nice if the converter could do the right thing in both situations.
If fixing the converter is too much work, we should audit the code for inherited constant references, apply the workaround, and adopt the convention of always using explicit class names for constants.