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

Cleanup extra lines in the ezurl_object_link table

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Fixed
    • Affects Version/s: Customer request, 4.7.0, 5.0, 5.1
    • Fix Version/s: Customer request, 5.2-beta1
    • Component/s: None
    • Labels:
      None

      Description

      The problem described in EZP-20988 created stale links in ezurl_object_link.

      A way to remove them must be implemented.

        Issue Links

          Activity

          Hide
          Yannick Roger (Inactive) added a comment -

          ezxml can have several ezurl objects in them. So we do not want to remove duplicates, because they are supposed to be. The script only takes care of the ezurl blocks.

          Your test case is perfect by the way

          Show
          Yannick Roger (Inactive) added a comment - ezxml can have several ezurl objects in them. So we do not want to remove duplicates, because they are supposed to be. The script only takes care of the ezurl blocks. Your test case is perfect by the way
          Hide
          Marcos Loureiro (Inactive) added a comment - - edited

          I'm doing this from what I remember
          @Joao Pingo do you confirm this?

          @[~yannick.roger@ez.no] ezxml can have several links, however, they also become invalid (i think) so shouldn't they be cleared also?
          ( for the <5.2 versions )

          example:

          1- Content Type A with: 
               - ezstring
               - ezxml - non translatable
          2- Content object B of Content Type A in language Z with: 
              - ezstring = Z Version 1
              - ezxml = http://ez.no and http://confluence.ez.no (links)
          

          if:
          B - id = 60
          B - ezxml - attribute id = 200
          then

          table: ezurl_object_link
          +----------------------------+---------------------------------+--------+
          | contentobject_attribute_id | contentobject_attribute_version | url_id |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               1 |     30 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               1 |     31 |
          +----------------------------+---------------------------------+--------+
          

          now:

          3- Translate B to language X:
               - ezstring = X Version 1
               - ezxml - <not translatable>
          

          so the table will look like:

          table: ezurl_object_link
          +----------------------------+---------------------------------+--------+
          | contentobject_attribute_id | contentobject_attribute_version | url_id |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               1 |     30 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               1 |     31 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               2 |     30 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               2 |     31 |
          +----------------------------+---------------------------------+--------+
          

          to end, edit links in Z language

          4- Edit B in language Z:
               - ezstring = Z Version 2
               - ezxml -  http://google.com and http://yahoo.com (links)
          

          the final table will look:

          +----------------------------+---------------------------------+--------+
          | contentobject_attribute_id | contentobject_attribute_version | url_id |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               1 |     30 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               1 |     31 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               2 |     30 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               2 |     31 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               3 |     30 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               3 |     31 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               3 |     32 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               3 |     33 |
          +----------------------------+---------------------------------+--------+
          

          so the following lines are invalid:

          +----------------------------+---------------------------------+--------+
          |                        200 |                               3 |     30 |
          +----------------------------+---------------------------------+--------+
          |                        200 |                               3 |     31 |
          +----------------------------+---------------------------------+--------+
          

          Show
          Marcos Loureiro (Inactive) added a comment - - edited I'm doing this from what I remember @ Joao Pingo do you confirm this? @ [~yannick.roger@ez.no] ezxml can have several links, however, they also become invalid (i think) so shouldn't they be cleared also? ( for the <5.2 versions ) example: 1- Content Type A with: - ezstring - ezxml - non translatable 2- Content object B of Content Type A in language Z with: - ezstring = Z Version 1 - ezxml = http://ez.no and http://confluence.ez.no (links) if: B - id = 60 B - ezxml - attribute id = 200 then table: ezurl_object_link +----------------------------+---------------------------------+--------+ | contentobject_attribute_id | contentobject_attribute_version | url_id | +----------------------------+---------------------------------+--------+ | 200 | 1 | 30 | +----------------------------+---------------------------------+--------+ | 200 | 1 | 31 | +----------------------------+---------------------------------+--------+ now: 3- Translate B to language X: - ezstring = X Version 1 - ezxml - <not translatable> so the table will look like: table: ezurl_object_link +----------------------------+---------------------------------+--------+ | contentobject_attribute_id | contentobject_attribute_version | url_id | +----------------------------+---------------------------------+--------+ | 200 | 1 | 30 | +----------------------------+---------------------------------+--------+ | 200 | 1 | 31 | +----------------------------+---------------------------------+--------+ | 200 | 2 | 30 | +----------------------------+---------------------------------+--------+ | 200 | 2 | 31 | +----------------------------+---------------------------------+--------+ to end, edit links in Z language 4- Edit B in language Z: - ezstring = Z Version 2 - ezxml - http://google.com and http://yahoo.com (links) the final table will look: +----------------------------+---------------------------------+--------+ | contentobject_attribute_id | contentobject_attribute_version | url_id | +----------------------------+---------------------------------+--------+ | 200 | 1 | 30 | +----------------------------+---------------------------------+--------+ | 200 | 1 | 31 | +----------------------------+---------------------------------+--------+ | 200 | 2 | 30 | +----------------------------+---------------------------------+--------+ | 200 | 2 | 31 | +----------------------------+---------------------------------+--------+ | 200 | 3 | 30 | +----------------------------+---------------------------------+--------+ | 200 | 3 | 31 | +----------------------------+---------------------------------+--------+ | 200 | 3 | 32 | +----------------------------+---------------------------------+--------+ | 200 | 3 | 33 | +----------------------------+---------------------------------+--------+ so the following lines are invalid: +----------------------------+---------------------------------+--------+ | 200 | 3 | 30 | +----------------------------+---------------------------------+--------+ | 200 | 3 | 31 | +----------------------------+---------------------------------+--------+
          Hide
          Joao Pingo (Inactive) added a comment -

          @Marcos
          Since this script only takes care of the ezurl datatype i've opened a separated issue https://jira.ez.no/browse/EZP-21574 with this issue

          Show
          Joao Pingo (Inactive) added a comment - @Marcos Since this script only takes care of the ezurl datatype i've opened a separated issue https://jira.ez.no/browse/EZP-21574 with this issue
          Hide
          Yannick Roger (Inactive) added a comment -

          The problem with xmltext url is that it is tricky to identify which urls are good or bad and the worst thing would be to delete non stale contents.

          Show
          Yannick Roger (Inactive) added a comment - The problem with xmltext url is that it is tricky to identify which urls are good or bad and the worst thing would be to delete non stale contents.
          Hide
          Joao Pingo (Inactive) added a comment -

          Tested on master using tc-1796 on Master (5.2)
          Test passed ... QA Approved

          Show
          Joao Pingo (Inactive) added a comment - Tested on master using tc-1796 on Master (5.2) Test passed ... QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Yannick Roger (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 5 hours, 30 minutes
                1w 5h 30m