Skip to content

Conversation

@laoneo
Copy link
Member

@laoneo laoneo commented Jan 30, 2026

Summary of Changes

When opening a back end list with tmpl=component parameter there is a javascript error for a missing element.

Testing Instructions

Open in the back end the url /administrator/index.php?option=com_content&view=articles&tmpl=component.

Actual result BEFORE applying this Pull Request

Javascript error:
can't access property "textContent", document.querySelector(...) is null

Expected result AFTER applying this Pull Request

No Javascript error.

Link to documentations

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

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.4-dev labels Jan 30, 2026
@laoneo laoneo added the bug label Jan 30, 2026
@brianteeman
Copy link
Contributor

brianteeman commented Jan 30, 2026

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

@laoneo
Copy link
Member Author

laoneo commented Jan 30, 2026

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.

@brianteeman
Copy link
Contributor

For me the bug is not the console error but the fact that the table column script will not run in this view

@laoneo
Copy link
Member Author

laoneo commented Jan 30, 2026

Thanks for sharing your opinion.

@brianteeman
Copy link
Contributor

pretty sure we already have a pr that would address the situation where the page does not have a title

@laoneo
Copy link
Member Author

laoneo commented Jan 30, 2026

I couldn't find one.

@laoneo laoneo added the PBF Pizza, Bugs and Fun label Jan 30, 2026
@465645
Copy link

465645 commented Jan 31, 2026

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 comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46776.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug NPM Resource Changed This Pull Request can't be tested by Patchtester PBF Pizza, Bugs and Fun PR-5.4-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants