Unable to put custom button on front end view #338
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#338
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
Created front view and added custom button to it that redirects to external address. The idea is to test the custom button functionality.
Target Controller Method: redirectExternal
Target: Both
Type: Default
PHP (controller methods):
Expected result
When clicking the button to redirect to the link
Actual result
Printing error that there is no function. When i enable the debug this is on line 123 which says:
123: if ($this->canDo->get('buttons.test_redirection'))
If i comment it out plus the if brackets and leave this code only:
i am getting then javascript errors and the command is not executed.
System information (as much as possible)
OS Name & Version: Centos 7.4
MySql Version: MariaDB 10
Apache Version: Nginx 1.12
PHP Version: 7.3
Joomla Version: 3.8.12
JCB Version: 2.9.0
Browser: Chrome
Additional comments
Did you try it with only function?
I have just now. Result is the same.
Peter
Can you give me a screenshot of the tab inside the site view, where you have all this setup?
Does the page load without the button?
yes it does, i can give you access to the site. Just please use the test view only because the MR project is under active development for production in the the next 2 weeks or so and i don't have backup of it.
No I don't want access... best keep this simple. I will run more test on my end, and get back to you.
OK thanks. Let me know if i can assist in the testing additionally.
Found the issue, seems Joomla change this area considerably (since the time we used it) so we will need to adapt JCB.
TODO:
JHtml::_('behavior.framework', true);
)$this->canDo->get(...)
values to the pageThanks. Let me know if there is anything i can do to assist. Not sure i can write core JCB yet but still.
I have just pushed the fix, please test the staging branch, and remember the button has permissions.
I can confirm that it works. I will start doing some more tests for what kind of functions I need to implement and let you know if anything pops up.
Thank you very much!
Peter