georgringer / news

TYPO3 Extension news
GNU General Public License v2.0
264 stars 358 forks source link

PluginUpdater.php fails with data lost for plugin that extends news #2353

Closed specialistaweb closed 7 months ago

specialistaweb commented 7 months ago

Hi thank yo for your work, I suppose the problem is linked to your file:

Classes/Updates/PluginUpdater.php

as I can see there are some lines that modify the pi_flexform DATA existing into the tabel tt_content

To be more precise it shoul be the following code:

        // Clean up flexform
        $newFlexform = $this->flexFormTools->cleanFlexFormXML('tt_content', 'pi_flexform', $record);
        $flexFormData = GeneralUtility::xml2array($newFlexform);
        // Remove flexform data which do not exist in flexform of new plugin
        foreach ($flexFormData['data'] as $sheetKey => $sheetData) {
            // Remove empty sheets
            if (!count($flexFormData['data'][$sheetKey]['lDEF']) > 0) {
                unset($flexFormData['data'][$sheetKey]);
            }
        }

This should happen wth all plugins that extendes news system.

In my case, migrating from v.10.x to v11.3 all the DATA of my extension NewsStylist was deleted,

Please investigate to avoid data lost.

georgringer commented 7 months ago

wanna do a PR?

specialistaweb commented 7 months ago

if you do mean this:

MARKETING abbreviation for public relations: the activity of providing the public with information about your organization so that people have a positive idea of the organization's work:

I don't wanna do a PR, I'm interested to know better where the problems resides to avoid future lost of data.

Maybe I'm wrong about your updater.

You are the author of news,, so I refer you for this without further purposes

georgringer commented 7 months ago

sorry no I mean "pull request". even though I am the author the flexform changes have been quite hard to implement and If you find a better way I would be happy to get a pull request to improve the current situation

specialistaweb commented 7 months ago

ok maybe the error is not linked to your Updater. I should inspect better. Please close this issue

specialistaweb commented 7 months ago

closed