Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-2500

Iterations in `normalize-paths` command are not calculated correctly

    XMLWordPrintable

Details

    • eZ Platform, Ibexa Content

    Description

      Imagine the following scenario:
      1. SELECT COUNT(DISTINCT(filepath)) FROM `ezimagefile`; gives 20 000 results.

      2. SELECT DISTINCT img.contentobject_attribute_id, img.filepath FROM `ezimagefile` img gives 120 000 results.

      3. The number of iterations will be equal to 20 000/100 = 200 - https://github.com/ezsystems/ezpublish-kernel/blob/7.5/eZ/Bundle/EzPublishCoreBundle/Command/NormalizeImagesPathsCommand.php#L232, 100 is taken from the constant.

      4. As each iteration fetches 100 records (https://github.com/ezsystems/ezpublish-kernel/blob/7.5/eZ/Bundle/EzPublishCoreBundle/Command/NormalizeImagesPathsCommand.php#L237) the total amount of processed pairs would be equal to 200*100=20000 but the number of results from step 2. requires 120 000 processed results.

      Result:
      Not all of the image paths will be processed.

      Expected result:
      All paths should be processed in one go.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              bartlomiej.wajda@ibexa.co Bartłomiej Wajda
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: