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

EzOE object insertion browsing tab pagination navigation return wrong offset and limit

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 3.9.0alpha1, 4.4.0, 4.4.0alpha1
    • None
    • Operating System: Any OS
      PHP Version: 5.3.6
      EzOE: 5.4.0
      Ez publish EE 4.6.0
      Browser (and version): Any Browser

    Description

      When inserting an object in a content with ezoe, a popup raises with differents tabs to upload, search, use bookmarks or browse the content tree to insert an object.
      This last tab have a buggy pagination system that use wrong offset informations from the json returned by the ezoe extension using ezjscore.

      The bug comes from the file ezoe/classes/ezoeserverfunctions.php in the ezoe extension.
      It's present since commit e00b704d by andrerom on 2010-04-14 that reworks most of the code from this file.
      https://github.com/ezsystems/ezoe/blob/e00b704dd7ab0a52ccd4078ea32ad1ab69f602ee/classes/ezoeserverfunctions.php

      On the array return by the browse method, offset and limit must be casted to int as the are string and then considered as octal value by the json transformation. Then, if you have a value of "10", its considered as a decimal 8 as 10 is the octal value of 8.

      Original code:

              return array(
                  'list' => $list,
                  'count' => count( $nodeArray ),
                  'total_count' => (int) $count,
                  'node' => ezjscAjaxContent::nodeEncode( $node, array('fetchPath' => true ), 'raw' ),
                  'offset' => $offset,
                  'limit' => $limit,
              );
      

      corrected code :

              return array(
                  'list' => $list,
                  'count' => count( $nodeArray ),
                  'total_count' => (int) $count,
                  'node' => ezjscAjaxContent::nodeEncode( $node, array('fetchPath' => true ), 'raw' ),
                  'offset' => (int) $offset,
                  'limit' => (int) $limit,
              );
      

      See attached patch.

      Note that the same return is used in the bookmatk method ant thus must be corrected in the same way.

      This bug is present on ezoe from version 5.2.0

      Steps to reproduce
      • Create a content from a class using an XML content and the ezoe editor do edit it;
      • click on the object button on the ezoe menu bar;
      • click on the browse tab;
      • navigate through contents and reach a folder containing more than 30 children to display. This normaly means 3 pages as the display limit is 10 by default. If the limit is not 10 on your system, either increase the object number or set the limit to an appropriate value to have at least 3 pages of content objects displayed.
      • Navigate using the next button until you reach a page with only the back button.
      • Click on the back button and then next and notice the mess in the offset value of the javascript function call.

      Attachments

        Activity

          People

            unknown unknown
            nicolas.massart@businessdecision.com nicolas.massart@businessdecision.com
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: