User tests: Successful: Unsuccessful:
When opening a back end list with tmpl=component parameter there is a javascript error for a missing element.
Open in the back end the url /administrator/index.php?option=com_content&view=articles&tmpl=component.
Javascript error:
can't access property "textContent", document.querySelector(...) is null
No Javascript error.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | JavaScript Repository NPM Change |
Not sure what to do then in the case when no table name is set and no page title is defined. Adding the name attribute to the tables is out of this scope for this pr.
For me the bug is not the console error but the fact that the table column script will not run in this view
Thanks for sharing your opinion.
pretty sure we already have a pr that would address the situation where the page does not have a title
I couldn't find one.
I have tested this item ✅ successfully on 21c8e72
C:\xampp\htdocs\joomlapbf\test_table_columns.html
Fixed a null reference error that occurred when opening backend lists with tmpl=component parameter, where the .page-title element doesn't exist. The main part fixed is:-
const tableName = $table.dataset.name
|| document.querySelector('.page-title')?.textContent?.trim()?.replace(/[^a-z0-9]/gi, '-')?.toLowerCase();
This PR fixes the console error but i am not sure it is enough. Both with and without this PR the table column selector is not loaded when it should be. This means that if you have used the table column selector to decide which columns are displayed then it is ignored when the tmpl=component is used