User tests: Successful: Unsuccessful:
Pull Request for Issue #45306.
Ensure the column selector always appears by safely retrieving the table name even when the "Title" module is unpublished.
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
Column selector did not appear when the "Title" module was unpublished.
Column selector appears even if the "Title" module is unpublished.
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 |
Labels |
Added:
NPM Resource Changed
PR-5.3-dev
|
@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?
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?
Title |
|
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?
did you test your work? please post screenshots of the different local storage keys
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-
Unchecking checkboxes updates joomla-tablecolumns-modules--administrator-.
joomla-tablecolumns-default-table-0 remains unchanged.
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.
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
I have tested this item ✅ successfully on c405abf
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!
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
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
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
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!
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
Test categories view of com_content
and com_banners
.
Both views have set all columns to show:
com_content
: Hide column "Published"com_banners
: Column "Published" is hidden.Same the other way around:
com_banners
: Set column "Published" to showcom_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.
it must be unique for every table
@Hemang360 Does Improved new key logic
means that comment is solved? To be sure i tested again by prebuilt packages but its not.
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
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
Normal with title