Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21124

Checkbox custom attributes on custom tags are not stored

    Details

      Description

      Steps to reproduce:

      Create or use one extension that defines a custom tag with a checkbox custom attribute not checked as default.

      When we check the attribute and click ok, ezoe will not apply it, if we try to edit the custom tag again we will see that the checkbox will not be checked, also if check and publish, ez publish will not save the value as well.

      test case:

      setup in content.ini settings:

      [newattr]
      CustomAttributes[]
      CustomAttributes[]=title
      CustomAttributes[]=testbox
      CustomAttributesDefaults[title]=texthere

      and in ezoe_attributes.ini:

      [CustomAttribute_newattr_title]
      Name=Some title
      Type=text

      [CustomAttribute_newattr_testbox]
      Name=TestBox
      Type=checkbox

        Issue Links

          Activity

          Thiago Campos Viana created issue -
          Paulo Bras (Inactive) made changes -
          Field Original Value New Value
          Affects Version/s 5.2 [ 12582 ]
          Affects Version/s 2013.07 [ 12581 ]
          Paulo Bras (Inactive) made changes -
          Fix Version/s Customer request [ 11018 ]
          Paulo Bras (Inactive) made changes -
          Status Open [ 1 ] Confirmed [ 10037 ]
          Paulo Bras (Inactive) made changes -
          Description Steps to reproduce:

          Create or use one extension that defines a custom tag with a checkbox custom attribute not checked as default.

          When we check the attribute and click ok, ezoe will not apply it, if we try to edit the custom tag again we will see that the checkbox will not be checked, also if check and publish, ez publish will not save the value as well.
          Steps to reproduce:

          Create or use one extension that defines a custom tag with a checkbox custom attribute not checked as default.

          When we check the attribute and click ok, ezoe will not apply it, if we try to edit the custom tag again we will see that the checkbox will not be checked, also if check and publish, ez publish will not save the value as well.

          test case:

          setup in content.ini settings:
          {quote}
          [newattr]
          CustomAttributes[]
          CustomAttributes[]=title
          CustomAttributes[]=testbox
          CustomAttributesDefaults[title]=texthere
          {quote}

          and in ezoe_attributes.ini:
          {quote}
          [CustomAttribute_newattr_title]
          Name=Some title
          Type=text

          [CustomAttribute_newattr_testbox]
          Name=TestBox
          Type=checkbox
          {quote}

          Gunnstein Lye made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          Hide
          Thiago Campos Viana added a comment - - edited

          Here's my workaround:

          Change extension/ezoe/design/standard/templates/ezoe/customattributes/checkbox.tpl with:

          http://pastebin.com/eCHg2Q8G

          Show
          Thiago Campos Viana added a comment - - edited Here's my workaround: Change extension/ezoe/design/standard/templates/ezoe/customattributes/checkbox.tpl with: http://pastebin.com/eCHg2Q8G
          Damien Pobel (Inactive) logged work - 28/Feb/14 10:39 AM
          • Time Spent:
            3 hours
             

            ...

          Damien Pobel (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Damien Pobel [ damien.pobel@ez.no ]
          Damien Pobel (Inactive) made changes -
          Summary eZ publish 2013.5 online editor problem with custom attribute - checkbox Checkbox custom attributes on custom tags are not stored
          Damien Pobel (Inactive) made changes -
          Affects Version/s 5.3-dev [ 12979 ]
          Hide
          Thiago Campos Viana added a comment -

          Yesterday I was discussing with Peter from mugo, and he found out that the problem may relies on:

          extension/ezoe/design/standard/javascript/ezoe/popup_utils.js

          There are some references to deprecated jQuery functions, if we replace:

          o.attr("checked")

          With

          o.is(':checked')

          Then the checkbox will almost work properly, the only problem is that when we disable and enable the editor it won't save the attribute properly, maybe it is because there are more deprecated stuff being used somewhere. My workaround is still the best option.

          Show
          Thiago Campos Viana added a comment - Yesterday I was discussing with Peter from mugo, and he found out that the problem may relies on: extension/ezoe/design/standard/javascript/ezoe/popup_utils.js There are some references to deprecated jQuery functions, if we replace: o.attr("checked") With o.is(':checked') Then the checkbox will almost work properly, the only problem is that when we disable and enable the editor it won't save the attribute properly, maybe it is because there are more deprecated stuff being used somewhere. My workaround is still the best option.
          Show
          Damien Pobel (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/896
          Damien Pobel (Inactive) made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Damien Pobel (Inactive) made changes -
          Remote Link This issue links to "Pull request (Web Link)" [ 13620 ]
          Hide
          Damien Pobel (Inactive) added a comment -

          Thanks Thiago for your comment, that's exactly what I've found. For the disable/enable editor, I think this happens if you don't set a "Default" in the custom attribute settings and from what I see, it's a different issue that seems to have been there like for ever!

          Show
          Damien Pobel (Inactive) added a comment - Thanks Thiago for your comment, that's exactly what I've found. For the disable/enable editor, I think this happens if you don't set a "Default" in the custom attribute settings and from what I see, it's a different issue that seems to have been there like for ever!
          Hide
          Peter Keung added a comment -

          Is the value something users rely on? If not, we could just hardcode it to "1".

          Show
          Peter Keung added a comment - Is the value something users rely on? If not, we could just hardcode it to "1".
          Hide
          Thiago Campos Viana added a comment - - edited

          So, here is my final thought about the disable/enable editor problem.

          When we check the checkbox, the value that will appears is the default value in the disabled editor, ONLY when the checkbox is checked, if the checkbox isn't checked then nothing will appears, that is how it works, so if we put

          [CustomAttribute_newattr_testbox]
          Name=TestBox
          Type=checkbox
          Default=anyValueHere

          Then, when we check the checkbox and disable the editor, the custom attribute will be shown like:

          <custom name="newattr" custom:title="texthere" custom:testbox="anyValueHere"></custom>

          If we uncheck the attribute it will be:

          <custom name="newattr" custom:title="texthere"></custom>

          Finally, if we do not define a Default value in the settings, it will be the same for checked as if it is unchecked, so, basically we need define the checked value by adding the Default setting.

          Show
          Thiago Campos Viana added a comment - - edited So, here is my final thought about the disable/enable editor problem. When we check the checkbox, the value that will appears is the default value in the disabled editor, ONLY when the checkbox is checked, if the checkbox isn't checked then nothing will appears, that is how it works, so if we put [CustomAttribute_newattr_testbox] Name=TestBox Type=checkbox Default=anyValueHere Then, when we check the checkbox and disable the editor, the custom attribute will be shown like: <custom name="newattr" custom:title="texthere" custom:testbox="anyValueHere"></custom> If we uncheck the attribute it will be: <custom name="newattr" custom:title="texthere"></custom> Finally, if we do not define a Default value in the settings, it will be the same for checked as if it is unchecked, so, basically we need define the checked value by adding the Default setting.
          Marcos Loureiro (Inactive) logged work - 03/Mar/14 9:10 AM
          • Time Spent:
            2 hours, 15 minutes
             

            Testing

          Damien Pobel (Inactive) made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 3 hours [ 10800 ]
          Worklog Id 46033 [ 46033 ]
          Show
          Damien Pobel (Inactive) added a comment - Fixed in ezpublish-legacy: master: http://github.com/ezsystems/ezpublish-legacy/commit/38d83f775b930d14d426d7dc01c0dc2d7fae0d0a
          Damien Pobel (Inactive) made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Fix Version/s 5.3 [ 11282 ]
          Fix Version/s 5.1 Maintenance [ 12301 ]
          Fix Version/s 5.2 Maintenance [ 12782 ]
          Damien Pobel (Inactive) made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Hide
          Damien Pobel (Inactive) added a comment -

          @Thiago: feel free to open a new issue for the disable editor problem as it's a completely different issue that mostly likely needs to be fixed in the server side handling

          Show
          Damien Pobel (Inactive) added a comment - @Thiago: feel free to open a new issue for the disable editor problem as it's a completely different issue that mostly likely needs to be fixed in the server side handling
          Marcos Loureiro (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Damien Pobel [ damien.pobel@ez.no ] Marcos Loureiro [ marcos.loureiro@ez.no ]
          Hide
          Peter Keung added a comment -

          New ticket opened for disable editor problem with a proposed fix: https://jira.ez.no/browse/EZP-22435

          Show
          Peter Keung added a comment - New ticket opened for disable editor problem with a proposed fix: https://jira.ez.no/browse/EZP-22435
          Joao Inacio (Inactive) made changes -
          Link This issue relates to EZP-22435 [ EZP-22435 ]
          Marcos Loureiro (Inactive) made changes -
          Time Spent 3 hours [ 10800 ] 5 hours, 15 minutes [ 18900 ]
          Worklog Id 46065 [ 46065 ]
          Marcos Loureiro (Inactive) logged work - 05/Mar/14 9:22 AM - edited
          • Time Spent:
            1 hour
             

            Testing

          Marcos Loureiro (Inactive) made changes -
          Time Spent 5 hours, 15 minutes [ 18900 ] 6 hours, 15 minutes [ 22500 ]
          Worklog Id 46075 [ 46075 ]
          Marcos Loureiro (Inactive) made changes -
          Worklog Id 46075 [ 46075 ]
          Marcos Loureiro (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Marcos Loureiro [ marcos.loureiro@ez.no ]
          Marcos Loureiro (Inactive) logged work - 06/Mar/14 11:12 AM
          • Time Spent:
            2 hours
             

            Testing and retesting on 5.1

          Marcos Loureiro (Inactive) made changes -
          Time Spent 6 hours, 15 minutes [ 22500 ] 1 day, 15 minutes [ 29700 ]
          Worklog Id 46079 [ 46079 ]
          Damien Pobel (Inactive) made changes -
          Assignee Damien Pobel [ damien.pobel@ez.no ]
          Damien Pobel (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Damien Pobel (Inactive) made changes -
          Status Development [ 3 ] Documentation done [ 10011 ]
          Marcos Loureiro (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Damien Pobel [ damien.pobel@ez.no ] Marcos Loureiro [ marcos.loureiro@ez.no ]
          Marcos Loureiro (Inactive) made changes -
          Rank Ranked higher
          Hide
          Marcos Loureiro (Inactive) added a comment -

          QA Approved

          Show
          Marcos Loureiro (Inactive) added a comment - QA Approved
          Marcos Loureiro (Inactive) logged work - 07/Mar/14 1:02 PM
          • Time Spent:
            45 minutes
             

            re-testing

          Marcos Loureiro (Inactive) made changes -
          Time Spent 1 day, 15 minutes [ 29700 ] 1 day, 1 hour [ 32400 ]
          Worklog Id 46203 [ 46203 ]
          Marcos Loureiro (Inactive) made changes -
          Assignee Marcos Loureiro [ marcos.loureiro@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Paulo Bras (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Paulo Bras (Inactive) made changes -
          Status Reopened [ 4 ] Confirmed [ 10037 ]
          Paulo Lopes (Inactive) made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          Yannick Roger (Inactive) made changes -
          Assignee Yannick Roger [ yannick.roger@ez.no ]
          Yannick Roger (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Yannick Roger (Inactive) made changes -
          Status Development [ 3 ] Documentation done [ 10011 ]
          Paulo Nunes (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Yannick Roger [ yannick.roger@ez.no ] Paulo Nunes [ paulo.nunes@ez.no ]
          Paulo Nunes (Inactive) made changes -
          Assignee Paulo Nunes [ paulo.nunes@ez.no ] Eduardo Fernandes [ eduardo.fernandes@ez.no ]
          Eduardo Fernandes (Inactive) made changes -
          Flagged Impediment [ 10000 ]
          Eduardo Fernandes (Inactive) made changes -
          Flagged Impediment [ 10000 ]
          Eduardo Fernandes (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Eduardo Fernandes [ eduardo.fernandes@ez.no ]
          Paulo Nunes (Inactive) made changes -
          Status InputQ [ 10001 ] Documentation [ 10010 ]
          Assignee Paulo Nunes [ paulo.nunes@ez.no ]
          Paulo Nunes (Inactive) made changes -
          Status Documentation [ 10010 ] Documentation done [ 10011 ]
          Paulo Nunes (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Paulo Nunes (Inactive) made changes -
          Assignee Paulo Nunes [ paulo.nunes@ez.no ] Eduardo Fernandes [ eduardo.fernandes@ez.no ]
          Eduardo Fernandes (Inactive) made changes -
          Fix Version/s 4.7.0 [ 11010 ]
          Hide
          Eduardo Fernandes (Inactive) added a comment -

          QA tested and approved for 5.3, 5.2, 5.1 & 4.7

          Show
          Eduardo Fernandes (Inactive) added a comment - QA tested and approved for 5.3, 5.2, 5.1 & 4.7
          Eduardo Fernandes (Inactive) made changes -
          Assignee Eduardo Fernandes [ eduardo.fernandes@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 56338 ] EZ* Development Workflow [ 83963 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 83963 ] EZEE Development Workflow [ 122590 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          242d 6h 5m 1 Paulo Bras (Inactive) 21/Feb/14 4:34 PM
          Development Development Development Review Development Review
          1h 21m 1 damien.pobel@ez.no 28/Feb/14 4:23 PM
          Development Review Development Review Development Review done Development Review done
          2d 17h 25m 1 damien.pobel@ez.no 03/Mar/14 9:49 AM
          Development Review done Development Review done Documentation Review done Documentation Review done
          17s 1 damien.pobel@ez.no 03/Mar/14 9:49 AM
          Closed Closed Reopened Reopened
          68d 21h 9m 1 Paulo Bras (Inactive) 15/May/14 11:12 AM
          Reopened Reopened Confirmed Confirmed
          5s 1 Paulo Bras (Inactive) 15/May/14 11:12 AM
          Confirmed Confirmed InputQ InputQ
          52m 56s 2 Paulo Lopes (Inactive) 15/May/14 11:41 AM
          InputQ InputQ Development Development
          8d 1h 36m 3 yannick.roger@ez.no 16/May/14 9:08 AM
          Development Development Documentation Review done Documentation Review done
          1h 58m 2 yannick.roger@ez.no 16/May/14 11:06 AM
          QA QA InputQ InputQ
          3d 3h 31m 2 eduardo.fernandes@ez.no 16/May/14 3:40 PM
          InputQ InputQ Documentation Documentation
          1h 36m 1 Paulo Nunes 16/May/14 5:16 PM
          Documentation Documentation Documentation Review done Documentation Review done
          24s 1 Paulo Nunes 16/May/14 5:17 PM
          Documentation Review done Documentation Review done QA QA
          21h 51m 4 Paulo Nunes 16/May/14 5:17 PM
          QA QA Closed Closed
          31m 2 eduardo.fernandes@ez.no 16/May/14 5:31 PM

            People

            • Assignee:
              Unassigned
              Reporter:
              Thiago Campos Viana
            • Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour
                1d 1h