Custom Code self reference check is off #365
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#365
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Create a custom code with the name "printSomething"
Type [CUSTOMCODE=printSomethingHelper] inside as if you wanted to include that custom code inside "printSomething".
Expected result
It saves, as there is no loop or self-reference.
Actual result
It removes [CUSTOMCODE=printSomethingHelper] and gives the following warning:
Additional comments
In my testing, this happens when the first part of the custom code name matches. For example with printSomethingHelper being included in printSomething.
Okay that warning is triggered by this little script on line 829 of the model of the custom_code view:
So first we check is there placeholders and then we on line 833 check that the method is not a
Hash (automation)
since that implementation, still does not allow custom code to be used in it, but the error should readCustom code can only be used in other custom code if set as <b>JCB (manual)</b>, you can not add them to <em>Hash (Automation)</em> code at this point.
which is not the error you gave.So that means we are on line 847 which loops the placeholders to see if it is the same as the current function name.... hmmm and here I see we can get negative/true results due to the
strpos
method. Okay got it... this is a bug, I will push out a fix, thanks!Please test the staging branch to see if the fix really resolved the issue for you.