Header compiler plugin creates incorrect output in (site)admin views #972
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#972
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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
Expected result
Actual result
Problem 1) The ordering is wrong.
You can't put code in the view and then use the 'use' keyword. The header compiler plugin does the following:
Clearly loading the text from the textarea first, then the 'use' cases. I understand this works on a lot of other pages so i don't understand why it doesn't work here (or rather does work on other pages)
Problem 2) missing closing bracket
Line 631 shows removing duplicate lines,causing the last bracket to not render since it's a duplicate of a different line. I understand now i could just change my code, and will do that now but it's still difficult to work around.
System information (as much as possible)
Hi @SimonvanDoorne, trust your doing well.
Okay so the header area was not intended to be used for code, but for adding
use namespace/classes
to areas where you would like to use those classes.That said, you can add code there, not ideal... but possible.
The current ordering places the powers second, and the header first... hmmm we are not really managing the ordering directly. I think it just end-up this way after being processed.
I looked at the code and we can in the plugin, just swap a few lines inside the getHeaders method to change the ordering.
So looking at line 578-602 you will see we are first loading the text, and then the powers. Just swap those around, and let me know if it resolves the issue. Once confirmed I can push the change out with the next update.
Hi Llewellyn,
Thanks for the response, i had a feeling i was using this area in unintended ways so i'm not surprised it didn't work right out of the gate :). The links you post give me a 404 page, and i can't find the repo through git/vdm/google either. Is it possible the repo is private?
Yes its private... I have now given you access.
I still get a 404
The link to the repo is https://git.vdm.dev/joomla/plg_extension_componentbuilderheaderscompiler right? Just checking if i'm not making any typos.
Hmmm not sure, let me check the permissions, one moment. My apologies... try again.
I have access now, thanks! I'm going to check the suggestions later today!
I already made the changes, and it should reflect with the next stable release.
As we now have a beta branch with all the latest fixes, I will direct you to it and consider this issue resolved. If you discover that the beta branch does not address the issue, please leave a comment here explaining what you found, and I will reopen this issue.
https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip