Review main Merged

51276[TASK] Add update wizard to migrate <link> tags to <a> tags

Christian Kuhn CR +2 V +2 Hard +244 −7 updated 04/03/17, 10:45

Commit message

Since the RteHtmlParser now stores updated content as <a>
tags instead of <link> tags an update wizard is provided
to convert links in all records that have input fields, textarea fields
or flexforms.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Frank Nägler +1
    • Jigal van Hemert +1
  • Verified V +2
    • Christian Kuhn +2
    • Frank Nägler +1
    • Jigal van Hemert +1
    • TYPO3com +1 CI

Issues 1

Files 7

Review log 3855

Show 2030 earlier messages
  1. Christian Kuhn uploaded patch set 1 01/11/17, 22:43

  2. Christian Kuhn commented on patch set 1 CR -1 01/11/17, 22:43

    parking kickstarted code here for a second ;)
  3. TYPO3com voted on patch set 1 V -1 01/11/17, 22:47 Completed build in 04m 28s on Wed, 11 Jan, 11:47 PM Test Summary: 54939 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6537

  4. Benni Mack uploaded patch set 2 01/12/17, 00:51

  5. TYPO3com voted on patch set 2 V -1 01/12/17, 00:56 Completed build in 04m 35s on Thu, 12 Jan, 01:56 AM Test Summary: 54939 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6542

  6. Markus Klein commented on patch set 3 01/12/17, 01:44

    Published edit on patch set 2.
  7. TYPO3com voted on patch set 3 V -1 01/12/17, 01:48 Completed build in 04m 19s on Thu, 12 Jan, 02:48 AM Test Summary: 54939 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6545

  8. Benni Mack uploaded patch set 4 01/12/17, 23:44

  9. Benni Mack updated the commit message in patch set 5 01/12/17, 23:45

  10. TYPO3com voted on patch set 4 V -1 01/12/17, 23:50 Completed build in 04m 58s on Fri, 13 Jan, 12:50 AM Test Summary: 54939 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6604

  11. TYPO3com voted on patch set 5 V -1 01/12/17, 23:51 Completed build in 05m 43s on Fri, 13 Jan, 12:51 AM Test Summary: 54939 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6605

  12. Christian Müllenhagen commented on patch set 5 01/13/17, 10:46

    RteLinkSyntaxUpdater.php:55

    This method does much more than checking for potential update tables. It also sets the table fields. This will create a temporal coupling. The following method "updateTableRow" will not work without this one.

    RteLinkSyntaxUpdater.php:97

    This could result in an error, if the given tableName not set in the array.

    RteLinkSyntaxUpdater.php:114

    Negate and return early (is easier to read).
  13. Christian Kuhn commented on patch set 5 01/16/17, 12:24

    RteLinkSyntaxUpdater.php:55 Reply

    that's planned and by design, see calling class.

    RteLinkSyntaxUpdater.php:114

    this string comparison will fail for flex, the flex values are htmlspecialchar'ed.
  14. Christian Müllenhagen commented on patch set 5 01/16/17, 16:47

    RteLinkSyntaxUpdater.php:55 Reply

    Is there a reason for that bad design? Is this because of "historical" reasons? Are other classes using classes which implement the RowUpdaterInterface?
  15. Christian Kuhn commented on patch set 5 01/16/17, 17:19

    RteLinkSyntaxUpdater.php:55 Reply

    https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/install/Classes/Updates/DatabaseRowsUpdateWizard.php // Single row updater instances are created only once for this method giving // them a chance to set up local properties during hasPotentialUpdateForTable() // and using that in updateTableRow() hasPotential() is called only once per table, while updateRow() is called for each row. Combining these methods gives the class a chance to prepare stuff in the first method, park it in a property and re-use that information for each row.
  16. Christian Müllenhagen commented on patch set 5 01/16/17, 18:46

    RteLinkSyntaxUpdater.php:55 Reply

    So that means that this class can only be used in this and only this context. Is that intended? What if you want to call "updateTableRow" in another class than the DatabaseRowsUpdateWizard. It will not work ... Or are you saying, this will never ever happen?!
  17. Benni Mack commented on patch set 5 01/16/17, 19:00

    That is correct, it's an update wizard for the install tool, nothing more. We're not talking about a functionality that will be used in different places in the TYPO3 Core for now.
  18. Christian Kuhn commented on patch set 5 01/16/17, 19:26

    RteLinkSyntaxUpdater.php:37

    we'll have to pimp this regex to cope with htmlspecialchar'ed content. Or, suggestion: Check in $globals['tca'] if a specific field is configured as type=flex. * If so, and if row is not empty, call GeneralUtility::xml2array * If returned content is an array (no error message) ** xml2array will de-htmlspecialchar() single field content (i hope). ** iterate through ... tabs, fields, section. ** For each found field or section container, check with the regex and do the migration * If something was changed, call GeneralUtility::array2xml() on the whole thing again and set as new row data. Guess, that should do, and hopefully we can suppress fetching the full data structure this way. To test / code, tx_styleguide_elements_rte together with some breakpoints in TcaFlexPrepare could become handy.
  19. Christian Müllenhagen commented on patch set 5 01/18/17, 23:10

    RteLinkSyntaxUpdater.php:89

    This method is hard to test. In fact it can only be achieved by using the "hasPotentialUpdateForTable" method or by mocking the member "tableFieldListToConsider". Both ways seem to be rather 'ugly'. Probably that's why no test has been written ;-)
  20. Mona Muzaffar uploaded patch set 6 02/24/17, 14:34

  21. TYPO3com voted on patch set 6 V -1 02/24/17, 14:46 Completed build in 12m 08s on Fri, 24 Feb, 03:46 PM Test Summary: 57501 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8499

  22. Mona Muzaffar uploaded patch set 7 02/28/17, 08:10

  23. TYPO3com voted on patch set 7 V -1 02/28/17, 08:20 Completed build in 10m 02s on Tue, 28 Feb, 09:20 AM Test Summary: 56297 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8733

  24. TYPO3com commented on patch set 7 03/04/17, 08:23 Completed build in 0h 23m 29s on Sat, 4 Mar, 09:23 AM Test Summary: 56297 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8733

  25. Mona Muzaffar uploaded patch set 8 03/21/17, 15:15

  26. TYPO3com voted on patch set 8 V +1 03/21/17, 15:24 Completed build in 08m 48s on Tue, 21 Mar, 04:24 PM Test Summary: 56473 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9403

  27. Jigal van Hemert commented on patch set 8 03/31/17, 21:03

    RteLinkSyntaxUpdater.php:136

    Won't ever reach the code inside this if statement. The surrounding if already checks the contents: - is_string(null) => false - empty(null) => true
  28. Jigal van Hemert uploaded patch set 9 04/02/17, 13:39

  29. TYPO3com voted on patch set 9 V -1 04/02/17, 13:47 Completed build in 07m 19s on Sun, 2 Apr, 03:47 PM Test Summary: 56554 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10158

  30. Christian Kuhn commented on patch set 9 CR -2 04/02/17, 13:55

    working on it.
  1. Christian Kuhn uploaded patch set 10 04/02/17, 14:13

  2. Christian Kuhn uploaded patch set 11 04/02/17, 14:15

  3. TYPO3com voted on patch set 10 V +1 04/02/17, 14:21 Completed build in 08m 03s on Sun, 2 Apr, 04:21 PM Test Summary: 56550 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10162

  4. TYPO3com voted on patch set 11 V +1 04/02/17, 14:24 Completed build in 09m 03s on Sun, 2 Apr, 04:24 PM Test Summary: 56550 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10163

  5. Christian Kuhn uploaded patch set 12 04/02/17, 15:22

  6. Christian Kuhn uploaded patch set 13 04/02/17, 15:22

  7. Christian Kuhn voted on patch set 13 CR 0 04/02/17, 15:23

  8. TYPO3com voted on patch set 12 V -1 04/02/17, 15:33 Completed build in 10m 33s on Sun, 2 Apr, 05:33 PM Test Summary: 56550 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10165

  9. TYPO3com voted on patch set 13 V +1 04/02/17, 15:34 Completed build in 11m 14s on Sun, 2 Apr, 05:34 PM Test Summary: 56550 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10166

  10. Jigal van Hemert voted on patch set 13 CR +1 04/02/17, 15:45

  11. Jigal van Hemert voted on patch set 13 V +1 04/02/17, 16:01

  12. Christian Kuhn commented on patch set 13 CR -1 04/02/17, 17:34

    found another detail. will update.
  13. Christian Kuhn uploaded patch set 14 04/02/17, 17:51

  14. TYPO3com voted on patch set 14 V +1 04/02/17, 18:02 Completed build in 10m 57s on Sun, 2 Apr, 08:02 PM Test Summary: 56550 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10172

  15. Christian Kuhn voted on patch set 14 CR -1 04/02/17, 18:04

  16. Jigal van Hemert uploaded patch set 15 04/02/17, 21:38

  17. Jigal van Hemert commented on patch set 15 04/02/17, 21:48

    The main question is why the legacyLinkNotationConverter can't handle the file:... URNs and resolve it.

    RteLinkSyntaxUpdater.php:167

    Not sure if this exception will ever by caught here as it is already caught in \TYPO3\CMS\Core\LinkHandling\LinkService::resolve()
  18. TYPO3com voted on patch set 15 V +1 04/02/17, 21:52 Completed build in 13m 19s on Sun, 2 Apr, 11:52 PM Test Summary: 56544 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10190

  19. Christian Kuhn uploaded patch set 16 04/03/17, 10:23

  20. TYPO3com voted on patch set 16 V +1 04/03/17, 10:31 Completed build in 08m 28s on Mon, 3 Apr, 12:31 PM Test Summary: 56550 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10211

  21. Christian Kuhn voted on patch set 16 CR +1 V +1 04/03/17, 10:34

  22. Frank Nägler voted on patch set 16 CR +1 V +1 04/03/17, 10:35

  23. Jigal van Hemert voted on patch set 16 CR +1 V +1 04/03/17, 10:40

  24. Christian Kuhn voted on patch set 16 CR +2 V +2 04/03/17, 10:43

  25. Gerrit merged patch set 16 04/03/17, 10:45