JoomGalleryfriends / JG4-dev

Development repository for JoomGallery v4.x
GNU General Public License v3.0
10 stars 6 forks source link

[Jg3ToJg4] Uncaught Throwable of type TypeError thrown with message / Return value must be of type array, bool returned #209

Closed imperialo closed 1 month ago

imperialo commented 3 months ago

Hi, nachdem die Migration fast durch war, kamen auf einmal diese Fehlermeldungen.

Viele Grüße Impi

`2024-03-14T19:15:26+00:00 ERROR 37.201.240.18 com_joomgallerymigration It was noticed that two different filenames were used for detail/original and thumbnail in the image with id: 37247 and alias: die-black-fairies-glamour-girls-auf-der-langener-skg-garderevue_2-37247. The migration script will skip the migration of this image. 2024-03-14T19:15:26+00:00 CRITICAL 37.201.240.18 error Uncaught Throwable of type TypeError thrown with message "Joomgallery\Component\Joomgallery\Administrator\Service\Migration\Scripts\Jg3ToJg4::convertData(): Return value must be of type array, bool returned". Stack trace: #0 [ROOT]/administrator/components/com_joomgallery/src/Model/MigrationModel.php(694): Joomgallery\Component\Joomgallery\Administrator\Service\Migration\Scripts\Jg3ToJg4->convertData()

1 [ROOT]/administrator/components/com_joomgallery/src/Controller/MigrationController.php(772): Joomgallery\Component\Joomgallery\Administrator\Model\MigrationModel->migrate()

2 [ROOT]/libraries/src/MVC/Controller/BaseController.php(730): Joomgallery\Component\Joomgallery\Administrator\Controller\MigrationController->start()

3 [ROOT]/libraries/src/Dispatcher/ComponentDispatcher.php(143): Joomla\CMS\MVC\Controller\BaseController->execute()

4 [ROOT]/libraries/src/Component/ComponentHelper.php(361): Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch()

5 [ROOT]/libraries/src/Application/AdministratorApplication.php(150): Joomla\CMS\Component\ComponentHelper::renderComponent()

6 [ROOT]/libraries/src/Application/AdministratorApplication.php(195): Joomla\CMS\Application\AdministratorApplication->dispatch()

7 [ROOT]/libraries/src/Application/CMSApplication.php(306): Joomla\CMS\Application\AdministratorApplication->doExecute()

8 [ROOT]/administrator/includes/app.php(58): Joomla\CMS\Application\CMSApplication->execute()

9 [ROOT]/administrator/index.php(32): require_once('...')

10 {main}`

Joomla! Version | 5.0.3 PHP Version | 8.2.15 Database | ServermysqlVersion10.5.24-MariaDBCollationutf8_general_ciConn Collationutf8mb4_general_ci

MrMusic commented 3 months ago

I can confirm the problem.

It was noticed that two different filenames were used for detail/original and thumbnail in the image with id: 37247 ...

The message says that there are different filenames for the thumbnail and the other images. This was possible in JG3. In future there will only be one file name for all images. A warning should appear in Step 2 of the migration script if there are such different file names. How many are there in your case?

Image filenames
There are different filenames for thumbnail and detail image defined in the database of your JG3 tables. Number of affected images: xx

If there are not many, you could try to unify the filenames (in DB and file system) and then test the migration again. But actually the script should continue to run and not terminate.

DE: Das Problem kann ich bestätigen.

It was noticed that two different filenames were used for detail/original and thumbnail in the image with id: 37247 ...

Die Meldung besagt es existieren unterschiediche Dateinamen für das Thumbnail und die anderen Bilder. Das war in der JG3 möglich. Zukünftig gibt es nur einen Dateinamen für alle Bilder. Im Step 2 des Migrationsskripts müsste eine Warnung erscheinen wenn es solche unterschiedliche Dateinamen gibt. Wieviele sind es bei dir?

Image filenames
There are different filenames for thumbnail and detail image defined in the database of your JG3 tables. Number of affected images: xx

Wenn es nicht viele sind, könntest du versuchen die Dateinamen zu vereinheitlichen (in DB und Filesystem) und dann die Migration nochmal testen. Aber eigentlich sollte das Skript trotzdem weiterlaufen und nicht abbrechen.

MrMusic commented 3 months ago

I have created a pull request https://github.com/JoomGalleryfriends/JG4-dev/pull/214 so that the error no longer occurs. The error is still reported in the log, but the script should no longer abort.

DE: Ich habe einen Pull request erstellt damit der Fehler nicht mehr auftritt. Im log wird der Fehler weiterhin angezeigt, aber das Skript sollte nicht mehr abbrechen.