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

Checkbox class attribute looses default state when class is imported from a package

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Legacy > Extensions
    • Labels:
      None
    • Environment:

      Version: 3.8
      PHP Version: php 4.4.2
      Webserver: apache_1.3.29
      Database: MySQL-server-4.1.11-0

      Description

      I create a class with a checkbox datatype with default value "checked".
      I create a package of the class that I want to import in some other ez installations
      When I import the package the class is created but the default value "checked" is lost.

      The exported package seems ok, the default value in lost during package import process:

      <attribute datatype="ezboolean"
      required="false"
      searchable="true"
      information-collector="false"
      translatable="true">
      <remote>
      <id>456</id>
      </remote>
      <name>spunta</name>
      <identifier>spunta</identifier>
      <placement>1</placement>
      <datatype-parameters>
      <default-value is-set="true" />
      </datatype-parameters>
      </attribute>

        Issue Links

          Activity

          Hide
          ezrobot added a comment -

          This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.

          Show
          ezrobot added a comment - This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.
          Hide
          Kristof Coomans added a comment -

          fixed in
          trunk (3.10.0beta1) rev. 19516
          stable/3.9 (3.9.3) rev. 19517
          stable/3.8 (3.8.9) rev. 19518

          Show
          Kristof Coomans added a comment - fixed in trunk (3.10.0beta1) rev. 19516 stable/3.9 (3.9.3) rev. 19517 stable/3.8 (3.8.9) rev. 19518
          Hide
          Brookins Consulting added a comment -

          Attached is simple patch which resolves this issue. Patched against and tested with 3.10alpha1

          This patch provides code changes needed to retain default state (checked or unchecked) of ezboolean datatype attributes during package import of classes.

          This is an older issue but one which affects a large number of users attempting to make full use of the package system.

          It would be very nice for this to be included in eZ Publish.

          Respectfully,
          Brookins Consultingezbooleantype.php.defaultvalue.patch

          Show
          Brookins Consulting added a comment - Attached is simple patch which resolves this issue. Patched against and tested with 3.10alpha1 This patch provides code changes needed to retain default state (checked or unchecked) of ezboolean datatype attributes during package import of classes. This is an older issue but one which affects a large number of users attempting to make full use of the package system. It would be very nice for this to be included in eZ Publish. Respectfully, Brookins Consulting ezbooleantype.php.defaultvalue.patch
          Hide
          Kristof Coomans added a comment -

          The serializeContentClassAttribute function exports the default value (checked or not) as the value of an attribute is-set of the default-value element, while the unserializeContentClassAttribute function uses the text content of the default-value element.

          Show
          Kristof Coomans added a comment - The serializeContentClassAttribute function exports the default value (checked or not) as the value of an attribute is-set of the default-value element, while the unserializeContentClassAttribute function uses the text content of the default-value element.

            People

            • Assignee:
              Kristof Coomans
              Reporter:
              Valerio Saggini
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: