? NPM Resource Changed bug PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar crystalenka
crystalenka
26 Aug 2022

Pull Request for Issue #38600 .

Summary of Changes

Added some checks in the plugins and layout fields to see if the parent fields are set as disabled. If so, set subfields to disabled also.

This is IN PROGRESS, feedback welcome.
Ready for review!

Left to do: Done!

  • Something funny is happening with disabled subforms that have media fields when you save them.
  • Make sure buttons on repeatable subforms are disabled or hidden when subform is disabled.

Testing Instructions

  • Make sure you have two users with different user groups, both with edit access to articles
  • As superuser, create a custom field of type "media".
    • In the "options" tab, set "display when read only" to "yes"
    • In the "permissions" tab, set the edit permissions for your other user to denied.
  • As superuser, create a custom field of type "subform" with at least one subfield.
    • In the "options" tab, set "display when read only" to "yes"
    • In the "permissions" tab, set the edit permissions for your other user to denied.
  • Login as the other user and navigate to the edit form where the custom fields are visible.

Actual result BEFORE applying this Pull Request

Media and subform fields are visible AND can be edited, or appear to be editable. Rows can be added and removed. Fields can be changed and text can be entered. However, any changes will not be saved to the database.

Expected result AFTER applying this Pull Request

Media and subform fields are visible but cannot be edited. Fields for media select, alt text, etc are disabled. Rows cannot be added or removed.

Documentation Changes Required

None to my knowledge.

avatar crystalenka crystalenka - open - 26 Aug 2022
avatar crystalenka crystalenka - change - 26 Aug 2022
Status New Pending
avatar crystalenka crystalenka - change - 26 Aug 2022
The description was changed
avatar crystalenka crystalenka - edited - 26 Aug 2022
avatar crystalenka crystalenka - change - 26 Aug 2022
The description was changed
avatar crystalenka crystalenka - edited - 26 Aug 2022
avatar joomla-cms-bot joomla-cms-bot - change - 26 Aug 2022
Category Administration com_fields Layout Front End Plugins
avatar crystalenka crystalenka - change - 26 Aug 2022
Labels Added: ?
avatar crystalenka crystalenka - change - 26 Aug 2022
The description was changed
avatar crystalenka crystalenka - edited - 26 Aug 2022
avatar crystalenka crystalenka - change - 26 Aug 2022
The description was changed
avatar crystalenka crystalenka - edited - 26 Aug 2022
avatar crystalenka
crystalenka - comment - 26 Aug 2022

This is as far as I can get it with my own skills. I'm not sure why the media field in disabled subforms breaks things so astonishingly.

Here's what I'm experiencing:

  • disabled subform already has content in media field and other fields. User cannot edit it, as expected with this PR.
  • Save the article
  • Any media fields in the disabled subform disappear from the table, and there is a warning: Invalid field:[Media field name]
  • The form looks broken, it's scary, refreshing the page doesn't help.
  • Closing the article and opening it again restores the previous un-broken state because nothing was actually saved.
avatar joomla-cms-bot joomla-cms-bot - change - 28 Oct 2022
Category Administration com_fields Layout Front End Plugins Administration com_fields Repository NPM Change Layout Front End Plugins
avatar crystalenka crystalenka - change - 28 Oct 2022
The description was changed
avatar crystalenka crystalenka - edited - 28 Oct 2022
avatar crystalenka
crystalenka - comment - 28 Oct 2022

All the strange edge cases and bugs (looking at you, accessible media field...) have now been resolved to the best of my knowledge. Ready for testing!

avatar crystalenka crystalenka - change - 28 Oct 2022
The description was changed
avatar crystalenka crystalenka - edited - 28 Oct 2022
avatar crystalenka crystalenka - change - 29 Oct 2022
Labels Added: NPM Resource Changed
avatar obuisard
obuisard - comment - 13 Jan 2023

Roland @roland-d do you want to move this one to 4.3 or include in in 4.2?

avatar roland-d
roland-d - comment - 14 Jan 2023

@obuisard This is fine for 4.2 given we have enough tests and all conversations are resolved.

avatar Quy
Quy - comment - 23 Jan 2023

Please fix conflicts.

avatar crystalenka crystalenka - change - 7 Feb 2023
Labels Added: Conflicting Files
avatar crystalenka
crystalenka - comment - 7 Feb 2023

There you go @Quy , sorry for the delay!

avatar HLeithner
HLeithner - comment - 2 May 2023

This pull request has been automatically rebased to 5.0-dev.

avatar crystalenka
crystalenka - comment - 2 May 2023

Hey @HLeithner and @Hackwar , this is a bug fix regarding access/permissions issues, not a feature. Is it possible to move this back to 4.3? It's pretty much ready though I see now I need to check why the build is failing.

avatar HLeithner
HLeithner - comment - 2 May 2023

I rebased it to 4.3-dev, not changing the label, RM for 4.3 should update the label if it's a bug.

avatar crystalenka
crystalenka - comment - 2 May 2023

Thank you Harald! @obuisard and @sdwjoomla , what are your thoughts?

avatar obuisard
obuisard - comment - 5 May 2023

Crystal @crystalenka, I think that is a UI/UX bug, so I would like to see it carried through 4.3.
However, we will need to adjust the code to rid of the conflicts

avatar sdwjoomla
sdwjoomla - comment - 5 May 2023

Agree with Olivier this is a bug as it does not function as expected

avatar obuisard
obuisard - comment - 5 May 2023

Crystal @crystalenka can you look at the conflicts? Let us know if you need help with that. Thanks!

avatar crystalenka
crystalenka - comment - 8 May 2023

Thank you! It's on my list and I will check it as soon as I can.

avatar obuisard
obuisard - comment - 31 May 2023

No pressure Crystal @crystalenka, just want to make sure you did not forget about it :-) Would love to see the fix in 4.3.3.

avatar crystalenka crystalenka - change - 13 Jul 2023
Labels Added: bug PR-4.3-dev
Removed: ?
avatar crystalenka
crystalenka - comment - 13 Jul 2023

Hi @obuisard , sorry for taking so long. I believe I fixed the conflicts now.

avatar obuisard
obuisard - comment - 13 Jul 2023

Hi @obuisard , sorry for taking so long. I believe I fixed the conflicts now.

Thank you very much Crystal @crystalenka. That will help get it tested :-)

avatar crystalenka crystalenka - change - 13 Jul 2023
Labels Removed: Conflicting Files
avatar Quy
Quy - comment - 19 Jul 2023

Log in as a non super user.
Edit an article.
See console.

38602

avatar crystalenka crystalenka - change - 26 Aug 2023
Labels Added: ?
avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 4.4-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Carry through disabled attribute to sub-fields in media and subform custom fields
[4.4] Carry through disabled attribute to sub-fields in media and subform custom fields
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar HLeithner
HLeithner - comment - 15 Nov 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 15 Nov 2024
Title
[4.4] Carry through disabled attribute to sub-fields in media and subform custom fields
[5.2] Carry through disabled attribute to sub-fields in media and subform custom fields
avatar HLeithner HLeithner - edited - 15 Nov 2024

Add a Comment

Login with GitHub to post a comment