0 users online. Create an account or sign in to join them.Users

Announcement

Symphony's issue tracker has been moved to Github.

Issues are displayed here for reference only and cannot be created or edited.

Browse

Closed#199: (2.0.7) XML result from "Allow Multiple" Events feels broken

XML from events between 2.0.6 and 2.0.7 appears identical for single-entry events, however Allow Multiple exhibits odd results in 2.0.7.

In 2.0.6 sending two entries in a post (a required image and a checkbox that is ticked):

<events>
    <save-user>
        <entry position="0" result="error">
            <message>Entry encountered errors when saving.</message>
            <profile type="missing" message="'Profile' is a required field." />
            <post-values>
                <enabled>on</enabled>
            </post-values>
        </entry>
        <entry position="1" result="error">
            <message>Entry encountered errors when saving.</message>
            <profile type="missing" message="'Profile' is a required field." />
            <post-values>
                <enabled>on</enabled>
            </post-values>
        </entry>
    </save-user>
</events>

And in 2.0.7:

<events>
    <save-user>
        <entry position="0" result="error">
            <message>Entry encountered errors when saving.</message>
            <profile type="missing" message="'Profile' is a required field." />
            <post-values>
                <item index="1">
                    <enabled>on</enabled>
                </item>
                <item index="2">
                    <enabled>on</enabled>
                </item>
            </post-values>
        </entry>
        <entry position="1" result="error">
            <message>Entry encountered errors when saving.</message>
            <profile type="missing" message="'Profile' is a required field." />
            <post-values>
                <item index="1">
                    <enabled>on</enabled>
                </item>
                <item index="2">
                    <enabled>on</enabled>
                </item>
            </post-values>
        </entry>
    </save-user>
</events>

Looks like the change in event.section.php line 24 is the offender:

General::array_to_xml($post_values, $post['fields'], true);

While neat and elegant, the XML returned appears incorrect in several ways:

  • several item nodes are created for each entry, should only be one
  • why are item nodes created at all?

At the moment this breaks backwards compatibility and feels broken.

Pull Accepted. Fixed

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details