fnagel / generic-gallery

TYPO3 extension: Generic Gallery - One gallery to rule them all!
https://extensions.typo3.org/extension/generic_gallery/
GNU General Public License v3.0
7 stars 12 forks source link

convertTypoScriptArrayToPlainArray() must be of the type array (PHP 7.x Issue?) #11

Closed Scunkaneli closed 5 years ago

Scunkaneli commented 7 years ago

Hi!

Using PHP 7.1.4 (I know it is not supported yet, but in another thread you said it's just because you could not test it yet) and Typo3 7.6.18 I get the following error when trying to add the generic-gallery extension to a page:

Argument 1 passed to TYPO3\CMS\Extbase\Service\TypoScriptService::convertTypoScriptArrayToPlainArray() must be of the type array, null given, called in [redacted]/typo3conf/ext/generic_gallery/Classes/Service/SettingsService.php on line 173

In error-log, I can see the following additional information:

TypeError thrown in file [redacted]/typo3_src-7.6.18/typo3/sysext/extbase/Classes/Service/TypoScriptService.php in line 32.

If I try to edit the page where I added the plugin, this error message is still shown. I have to completly delete the page to eliminate the error. Opening the page via browser just shows a completly empty page.

Of course I'm not sure this is caused by my usage of PHP 7.1.4, but I wasn't able to find another user having the same problem and as PHP 7.1.4 is untested, I guess it has something to do with it.

Edit: I just noticed you live in Germany too, so if you want you can answer in German :)

fnagel commented 7 years ago

Hey there!

Right, PHP 7.1 is not tested yet but I assume it should work without issues.

Actually there is another user with a similar issue but using PHP 7.0.10, see https://forge.typo3.org/issues/78454 (yes, bot, forge and GH is somehow bad, I already plan to move forge issues to GH). The ticket is missing a solution until now :-/

Please try adding the static TS on root and test if that works for you. There seems to be some issues with the SettingService lately. I need to check this but did not have the time yet...

Anubiso commented 7 years ago

Hey together,

I get the same error in TYPO3 7 LTS (7.6.18) and PHP 7.0.* in composer-mode.

Added the static TS for generic_gallery and bootstrap_example (also directly in the root-template), but can't create a content-element because of the error. The settings retrieved from the SettingService: $setup = $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT ); don't include plugin.tx_genericgallery. They look incomplete.

Anubiso commented 7 years ago

intermediate result:

I have now overwritten the generic_gallery TCA, removed the itemsProcFunc-hook and re-added the needed items with TCA.

unset($GLOBALS['TCA']['tt_content']['columns']['tx_generic_gallery_predefined']['config']['itemsProcFunc']);
$GLOBALS['TCA']['tt_content']['columns']['tx_generic_gallery_predefined']['config']['items'] = [
    ['Default Gallery', 'gallery'],
    ['Bootstrap Image Slider', 'bootstrap_slider_image'],
];

Also see http://stackoverflow.com/a/43789084/5070154 in regards of using TypoScript in the Backend-Context.

Scunkaneli commented 7 years ago

I haven't had much time to work on the page, so sorry for the delay.

Please try adding the static TS on root and test if that works for you.

I guess you mean including the generic_gallery template in BE? I already did that, so that's not the problem I guess.

@Anubiso Sadly, I can't say much about your intermediate solution, as I'm not sure I understood you correctly (not a typo3 pro here). Am I right, you basicly include the template via command and not via BE?

Anubiso commented 7 years ago

@Scunkaneli Close - I am also including the TypoScript, but have overwritten the TCA of generic_gallery to remove the hook which tries to read the TypoScript, because there happens the error:

unset($GLOBALS['TCA']['tt_content']['columns']['tx_generic_gallery_predefined']['config']['itemsProcFunc']); 

You can do this in a small extension or in the typo3conf/AdditionalConfiguration.php and with

$GLOBALS['TCA']['tt_content']['columns']['tx_generic_gallery_predefined']['config']['items'] = [
    ['Default Gallery', 'gallery'],
    ['Bootstrap Image Slider', 'bootstrap_slider_image'],
]; 

you can statically re-add the items (you have to include all templates which you want to use)

Scunkaneli commented 7 years ago

Alright, thanks! Are all functions of the gallery working with this method?

Anubiso commented 7 years ago

Yes, would say so - or better said: I haven't found something which doesn't work with his method.

Scunkaneli commented 7 years ago

Update: After upgrading to CMS 8.7.1 and without changing anything on the configuration nor using the code @Anubiso provided, the error is gone. :)

fnagel commented 7 years ago

Finally found time to dig into this. Switched back to how TS was generated before the SettingsService. Seems to work probably now, regardless where the TS is included (root template, additional template, root page, ...).

Would you mind to test the latest master and give some feedback?

Scunkaneli commented 7 years ago

I was able to test the master and I can confirm everything I tried worked (showing an existing gallery, creating a new gallery, edit an existing gallery).

Put please keep in mind that, as I already wrote some months ago, the error never occured on CMS 8. So the master did not fix anything for me (as everything was already working with 8), but also did not break anything.

fnagel commented 7 years ago

@Scunkaneli Wow, that was fast :-D

Ok, thanks for the feedback anyway. I've tested this in 8.7 and was able to reproduce and fix the issue. In 7.6 the error did not occur but the new generation works as expected.

We'll see if anybody else is able to test this probably. There are a two other similar error reports on forge which I've updated too.

fnagel commented 6 years ago

@Anubiso Any feedback on this issue?

mario6097 commented 6 years ago

Hi

I just tried to install generic-gallery, and run into the error. I am on a TYPO3 7.6.23, and PHP version: 5.5.30. I am not sure whether/how you fixed it (i mean without to update to v.8), I appreciate your advise. greetings

fnagel commented 6 years ago

@mario6097 Which version of GG did you use?

fnagel commented 6 years ago

@mario6097 Forgot to mention that

I am not sure whether/how you fixed it (i mean without to update to v.8)

You don't need to update to TYPO3 8.x, just use the current master branch!

fnagel commented 6 years ago

@mario6097 Any feedback on the current master branch?

fnagel commented 5 years ago

Any feedback on this issue?

fnagel commented 5 years ago

Closed as no feedback was given.