Closed h-e-l-l-o-w-o-r-l-d closed 1 year ago
Hi. I'm perplex. I'm not that familiar with PHP attributes. I copied the structure from the Core. There are several classes that use the same attribute structure in the Core (v12) and it works fine on PHP 8.2. I guess the whole attribute syntax is ignored with PHP 7.4, but as far as I can tell, the syntax is correct for PHP 8.2.
Is your backend entirely crashed or does this happen only when you run an import or access the External Import module, for example?
I have run my test instance with TYPO3 v12 and PHP 8.2, and it runs fine. However I don't have a test instance with TYPO3 v11 and PHP 8.2...
It crashes BE and FE completely (with PHP 7.4, PHP 8.2 is working for whatever reason). Only going back to 6.3.2. helps.
Well, the feature was introduced in TYPO3 12, so maybe that's the reason why it's not working in TYPO3 11? If so, that would mean 7.x is not TYPO3 11 compatible. :-/
I have a web site running TYPO3 11, External Import 7.1 and PHP 8.0. I made a test locally, by raising the PHP version to 8.2 and I had no error whatsoever. So I'm afraid that I have absolutely no clue as to what's happening to you :-\
according to https://www.php.net/manual/en/language.attributes.syntax.php the syntax is
#[MyAttribute(array("key" => "value"))]
,
so shouldn't it be
#[WebhookMessage(
array("identifier" => "...", "description" => "...")
)]
?
Another point is if an attribute is read correctly if it uses several lines?
I'm not experienced with the attributes, so excuse if I'm wrong.
First of all, appologies for mismatching the PHP versions in my descriptions. It works with PHP 8.2 but not 7.4! My description was the opposite! I changed it accordingly.
Thanks to @DavidBruchmann, this pointed me in the right direction. I investigated further and made some tests. The reason is indeed the multiline approach. This won't work with PHP 7.4, see here:
https://php.watch/versions/8.0/attributes#syntax -> "When an attribute is used in its own line, it will not cause a syntax error in PHP versions prior to 8.0"
I changed it to a single line and this works in PHP 7.4!
To test it, you have to Flush TYPO3 and PHP Cache in the maintenance module. Then the BE/FE, database analyse etc. is broken.
Would it be possible to provide a bugfix-release?
Ah, this makes more sense. Thanks for digging. Yes, I will provide a bugfix release ASAP.
Thanks alot and keep it up!
I just released version 7.1.1: https://github.com/cobwebch/external_import/releases/tag/7.1.1
Hi there,
I updated from 6.3.2. to 7.1. on TYPO3 11.4.30. Now I get the following error:
syntax error, unexpected ',' in /var/www/intranet-test/public/typo3conf/ext/external_import/Classes/Message/AfterImportMessage.php line 27
... on an apache server with PHP 7.4. It works on a server with PHP 8.2.
Webhhooks were introduced in TYPO3 12 and your extension supports 11 + 12. and PHP 7.4. + 8.x. Are webhook definitions gracefully ignored on a TYPO3 11 instance?
However, I'm out of ideas for now. Is the behaviour normal or can anything be done to fix this? Workaround is to switch back to 6.3.2 -> then it works on both servers.
Thanks in advance!