GetItems Method is unable to render html in list view #775
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#775
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
Create admin view with a text field with name "receiptbtn"
Under the PHP tab in the jcb admin view add this code under "Add PHP (getItems Method - after all) *" option.
Save, compile, install and test.
Expected result
The admin view is supposed to have an item with a button and an input field on the list. like the one in the photo.
Actual result
Instead, it strips all the httml tags and displays only the button label. as seen below.
System information (as much as possible)
OS Name & Version: Linux business39.web-hosting.com 2.6.32-954.3.5.lve1.4.82.el6.x86_64
MySql Version: 10.3.28-MariaDB-log-cll-lve
Apache Version: Apache
PHP Version: 7.3.28
Joomla Version: Joomla! 3.9.28 Stable
JCB Version: Version: 2.12.9
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Additional comments
There is a method called escape that by default triggers on all fields.
To turn this off you will need to add property to your field, check out this tutorial: https://github.com/vdm-io/Joomla-Component-Builder/wiki/027-How-to-ensure-that-a-field-is-not-escaped-when-added-to-list-views
Next you must in the list view look at the field_name being used to echo out the value, and be sure to target the same field_name in the module. This name can be different from the field name in the database, as the modeling and joins at times results in different names.
if you have any further questions let me know.