Details

      Description

      When I make a custom attribute as a checkbox (I've tried to add it on the embed tag) the value is not checked when it should. Seems like it doesn't save the value correctly either so I cant use it in a template.

      Added custom attributes in OE as a feature request to eZ in 2005, and I'm very happy it is in the new version. Seems to work very good for other types (text).

      Steps to reproduce

      content.ini.append:
      [embed]
      CustomAttributes[]=test

      ezoe_attributes.ini.append
      [CustomAttribute_test]
      Type=checkbox

      The checkbox shows up fine, but if I check it or not it still doesnt have a value in the template not is it showing up correctly if i edit the object again.

      Using version in eZP 4.1.3

        Activity

        Hide
        Jo Henrik Endrerud added a comment -

        Some small typos in the text earlier. The last sentence should be:
        "The checkbox shows up fine, but whether I check it or not, it still doesn't have a value in the template, nor is it showing up correctly if i edit the object again."

        Show
        Jo Henrik Endrerud added a comment - Some small typos in the text earlier. The last sentence should be: "The checkbox shows up fine, but whether I check it or not, it still doesn't have a value in the template, nor is it showing up correctly if i edit the object again."
        Hide
        André R added a comment -

        In reply to comment #064736
        Just a quick comment, I think you need to define default value to get checkbox to work. As it otherwise would have empty value, so when dialog comes back up, it will intrepid it as unchecked.

        Something like:

        [CustomAttribute_test]
        Type=checkbox
        Default=true
        

        Does that help?

        Show
        André R added a comment - In reply to comment #064736 Just a quick comment, I think you need to define default value to get checkbox to work. As it otherwise would have empty value, so when dialog comes back up, it will intrepid it as unchecked. Something like: [CustomAttribute_test] Type=checkbox Default=true Does that help?
        Hide
        Jo Henrik Endrerud added a comment -

        In reply to comment #064737
        I have tried this, but it didn't work.

        Show
        Jo Henrik Endrerud added a comment - In reply to comment #064737 I have tried this, but it didn't work.
        Hide
        André R added a comment -

        I can not reproduce this issue, value is present in template and checkbox remember its state.

        content.ini:

        [CustomTagSettings]
        AvailableCustomTags[]=underline
        IsInline[underline]=true
         
        [underline]
        CustomAttributes[]=check
        

        ezoe_attributes.ini:

        [CustomAttribute_underline_check]
        Type=checkbox
        Default=true
        

        underline.tpl:

        {* DO NOT EDIT THIS FILE! Use an override template instead. *}<u>{$content}</u>
        {$check}
        

        Value "true" was displayed when checked and nothing when it wasn't.
        I also tested it on embed tag, it remembered it's state there as well.
        Tested in ezp 4.3.0 from svn and ezoe 5.0.4 from svn.

        Show
        André R added a comment - I can not reproduce this issue, value is present in template and checkbox remember its state. content.ini: [CustomTagSettings] AvailableCustomTags[]=underline IsInline[underline]=true   [underline] CustomAttributes[]=check ezoe_attributes.ini: [CustomAttribute_underline_check] Type=checkbox Default=true underline.tpl: {* DO NOT EDIT THIS FILE! Use an override template instead. *}<u>{$content}</u> {$check} Value "true" was displayed when checked and nothing when it wasn't. I also tested it on embed tag, it remembered it's state there as well. Tested in ezp 4.3.0 from svn and ezoe 5.0.4 from svn.
        Hide
        Mark Marsiglio added a comment -

        Not sure if it is a regression in 5.1, but I am able to reproduce this issue. I added the test checkbox attribute in a new custom tag, and the checkbox has a mind of its own. If I uncheck the box, then close the properties dialog (hit OK), then edit the custom tag properties again, the box is checked. If I leave it checked then publish the page, calling the value results in "true", but if I uncheck the box and go through the same process it still reads "true".

        I copied your settings into content.ini and ezoe_attributes.ini.

        Show
        Mark Marsiglio added a comment - Not sure if it is a regression in 5.1, but I am able to reproduce this issue. I added the test checkbox attribute in a new custom tag, and the checkbox has a mind of its own. If I uncheck the box, then close the properties dialog (hit OK), then edit the custom tag properties again, the box is checked. If I leave it checked then publish the page, calling the value results in "true", but if I uncheck the box and go through the same process it still reads "true". I copied your settings into content.ini and ezoe_attributes.ini.
        Hide
        André R added a comment -

        Fixed in
        trunk (5.2.0beta2) rev. 280
        stable/5.1 (5.1.1) rev. 281

        Show
        André R added a comment - Fixed in trunk (5.2.0beta2) rev. 280 stable/5.1 (5.1.1) rev. 281
        Hide
        Brendan Pike added a comment -

        I just tested this on the 5.3.0 branch and I believe this bug must of been reintroduced.

        Show
        Brendan Pike added a comment - I just tested this on the 5.3.0 branch and I believe this bug must of been reintroduced.
        Hide
        André R added a comment -

        In reply to comment #064742
        but is it present in master?

        Show
        André R added a comment - In reply to comment #064742 but is it present in master?

          People

          • Assignee:
            André R
            Reporter:
            Jo Henrik Endrerud
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: