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

Error when Copy subtree "Database error"

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: High High
    • None
    • 2.4.2
    • None
    • LAMP, PHP 7.1.20

    Description

      When using multisite ezplatform, we copied a large subtree in the administration, we encountered a "Database error".

      We also tried the command-line command, and it's an SQL error on the url alias level:

      php bin/console ezplatform:copy-subtree 5711 2
      Are you sure you want to copy `XXXX` subtree (no. of children: 129) into `YYYY`? This make take a while for big number of nested children [Y/n]? Y
      
      In ExceptionConversion.php line 196:
      
        Database error
      
      
      In AbstractMySQLDriver.php line 55:
      
        An exception occurred while executing 'INSERT INTO `ezurlalias_ml` (`action`, `action_type`, `alias_redirects`, `id`, `is_alias`, `is_original`, `lang_mask`, `link`, `pare
        nt`, `text`, `text_md5`) VALUES (:placeholder1, :placeholder2, :placeholder3, :placeholder4, :placeholder5, :placeholder6, :placeholder7, :placeholder8, :placeholder9, :pl
        aceholder10, :placeholder11)' with params ["eznode:7810", "eznode", "0", "6089", "0", "1", "5", "6089", "6085", "actus", "7fa84f564781d108c349880febb9298c"]:
      
        SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6085-7fa84f564781d108c349880febb9298c' for key 'PRIMARY'
      

      It seems that during this copy the same url alias tries to create itself several times.

      We did not find the cause of the problem but adding a control to avoid recreating an already created alias in the method "copySubtree" in the classe "vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Handler.php" temporary solves our problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            alex57 alex57
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: