NPM Resource Changed PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar Hemang360
Hemang360
18 Apr 2025

Pull Request for Issue #45306.

Summary of Changes

Ensure the column selector always appears by safely retrieving the table name even when the "Title" module is unpublished.

Testing Instructions

  • Go to Modules (Administrator).

  • Unpublish the module with the title "Title".

  • Refresh the page and check that the column selector still appears.

  • Test other module views to confirm the selector works universally

Actual result BEFORE applying this Pull Request

image
Column selector did not appear when the "Title" module was unpublished.

Expected result AFTER applying this Pull Request

image
Column selector appears even if the "Title" module is unpublished.

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

avatar Hemang360 Hemang360 - open - 18 Apr 2025
avatar Hemang360 Hemang360 - change - 18 Apr 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2025
Category JavaScript Repository NPM Change
avatar Hemang360 Hemang360 - change - 18 Apr 2025
Labels Added: NPM Resource Changed PR-5.3-dev
avatar brianteeman
brianteeman - comment - 18 Apr 2025

Again this doesnt work.

When a user makes a selection of which columns to display for a table that selection is saved in the browser local storage. For the selection to be specific for each table the key must be unique. With this PR there is just one key "joomla-tablecolumns-default-table" so if you make a selection on one table then every table changes. And as the Value is stored as numeric values it will not be consistent across tables either

With this PR AND no title

image

Normal with title

image

avatar Hemang360
Hemang360 - comment - 18 Apr 2025

@brianteeman Thank you! I understand the issue now. I'll revise the PR to generate a unique fallback tableName for each table using its position in the DOM. Would that approach be acceptable?

avatar Hemang360
Hemang360 - comment - 20 Apr 2025

Hi @brianteeman,
I've updated the PR to ensure each table has a unique localStorage key, even when no title is present. Could you please take a look and let me know if this approach works better?

avatar Hemang360 Hemang360 - change - 20 Apr 2025
Title
Fix column selector not showing when "Title" module is unpublished
[5.3] Fix column selector not showing when "Title" module is unpublished
avatar Hemang360 Hemang360 - edited - 20 Apr 2025
avatar brianteeman
brianteeman - comment - 20 Apr 2025

Are you sure that this code will create a unique key for each table

In my test it just creates a single key

image

avatar Hemang360
Hemang360 - comment - 20 Apr 2025

I've updated the code to ensure that each table gets a unique localStorage key. Can you please check again and let me know if this resolves the issue you're encountering?

avatar brianteeman
brianteeman - comment - 20 Apr 2025

did you test your work? please post screenshots of the different local storage keys

avatar Hemang360
Hemang360 - comment - 20 Apr 2025

I tested the behavior with and without the fix applied, and here's what I observed:

There are two keys in localStorage:

joomla-tablecolumns-default-table-0

joomla-tablecolumns-modules--administrator-

  • When the title is published (with the fix applied):

Unchecking checkboxes updates joomla-tablecolumns-modules--administrator-.

joomla-tablecolumns-default-table-0 remains unchanged.

  • When the title is unpublished:

Unchecking checkboxes now updates joomla-tablecolumns-default-table-0.

joomla-tablecolumns-modules--administrator- remains unchanged.

Let me know if this behavior aligns with what’s expected or if you'd like me to test in a different scenario.

avatar brianteeman
brianteeman - comment - 20 Apr 2025

As stated before you need to test it with ALL views that have a column selector. Each view must have it's own and key/value pair

avatar chmst chmst - test_item - 22 Apr 2025 - Tested successfully
avatar chmst
chmst - comment - 22 Apr 2025

I have tested this item ✅ successfully on c405abf


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45351.

avatar Hemang360
Hemang360 - comment - 22 Apr 2025

I've fixed the issue with the localStorage key not being unique in the table-columns script. The fix has been tested and is working as expected.

However, the current PR has become a bit messy with multiple commits and merge history, which might make it harder to review.
Would it be alright if I close this PR and open a new one with a single, clean commit that contains just the final fix?

Thanks again for your help and support!

avatar chmst
chmst - comment - 22 Apr 2025

No need for a new PR. Testers see the code and the result.

Modue title enabled:

grafik

Modole title disabled:

grafik

avatar brianteeman
brianteeman - comment - 22 Apr 2025

Its almost unique ;)

when the title is disabled the key for article categories and contacts categories is the same

joomla-tablecolumns-categories

when the title is enabled the key is unique for each

joomla-tablecolumns-articles--categories
joomla-tablecolumns-contacts--categories

when the title is disabled the key for field groups and user groups is the same

joomla-tablecolumns-groups
when the title is enabled the key is unique for each

joomla-tablecolumns-articles--field-groups
joomla-tablecolumns-users--groups

There may be some others

avatar brianteeman
brianteeman - comment - 22 Apr 2025

Its almost unique ;)

when the title is disabled the key for article categories and contacts categories is the same

joomla-tablecolumns-categories

when the title is enabled the key is unique for each

joomla-tablecolumns-articles--categories
joomla-tablecolumns-contacts--categories

when the title is disabled the key for field groups and user groups is the same

joomla-tablecolumns-groups

when the title is enabled the key is unique for each

joomla-tablecolumns-articles--field-groups
joomla-tablecolumns-users--groups

There may be some others

avatar brianteeman
brianteeman - comment - 29 Apr 2025

Been thinking about this and I would be in favour of completely dropping the option to use the title as the key and instead adopt your proposal in the post above. It will also have the benefit of being language agnostic and solve #39980

The only downside would be that any settings on existing sites would be lost on upgrade.

Maintainers can make a decision on if that is acceptable.

If not then just go with your proposal in the post above but only when the title is not available

avatar Hemang360
Hemang360 - comment - 30 Apr 2025

Should I go ahead and commit the version of the code that uses the new key logic so you can check it out and see the results in action?

Happy to proceed once you confirm!

avatar brianteeman
brianteeman - comment - 30 Apr 2025

go ahead and create the new key logic to be used when title is not available

maintainers can decide if it becomes the default or remains the fallback option

avatar fgsw
fgsw - comment - 3 May 2025

Test categories view of com_content and com_banners.
Both views have set all columns to show:

  1. com_content: Hide column "Published"
  2. reload com_banners: Column "Published" is hidden.

Same the other way around:

  1. com_banners: Set column "Published" to show
  2. reload com_content: Column "Published" is shown.

Summary: User can't set different columns to hide/show in different categories-views.


Comment: @Hemang360 Thanks for working to solve the issue.
Thanks @chmst and @brianteeman for test the pull request.

avatar brianteeman
brianteeman - comment - 3 May 2025

it must be unique for every table

avatar fgsw
fgsw - comment - 5 May 2025

@Hemang360 Does Improved new key logic means that comment is solved? To be sure i tested again by prebuilt packages but its not.

avatar LadySolveig
LadySolveig - comment - 21 Jun 2025

I have started to work on a webcomponent for the table toggle coluumn, but is not finalized yet. Hopefully I will find the time in the next few weeks to get further with this. Just wanted to mention it here briefly, if this is an approach that would be interesting, we could also continue to work together here. #44497

Add a Comment

Login with GitHub to post a comment