Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API broken in release 3.6.10 #906

Open
bramley opened this issue Nov 7, 2022 · 8 comments
Open

API broken in release 3.6.10 #906

bramley opened this issue Nov 7, 2022 · 8 comments
Labels

Comments

@bramley
Copy link
Contributor

bramley commented Nov 7, 2022

Raising this problem here because I am not sure whether it is with the build process or somewhere else.

Using the API I get php errors because of the use of literal ReadOnly in a file in the jms package

PHP Parse error: syntax error, unexpected token "readonly" in /home/duncan/www/lists_3.6.10/base/vendor/jms/serializer/src/JMS/Serializer/Metadata/Driver/AnnotationDriver.php on line 80

In php 8.1 readonly is a reserved keyword.
But looking at the jms CHANGELOG.md file, it seems to be version 1.14.1 from 2020-02-22. In GitHub the current version of the jms package at schmittjoh / serializer is now 3.15.0 and the issue appears to have been resolved because ReadOnly has been changed to ReadOnlyProperty.

@bramley bramley added the bug label Nov 7, 2022
@phpListDockerBot
Copy link
Contributor

This issue has been mentioned on phpList Discuss. There might be relevant details there:

https://discuss.phplist.org/t/api-v2-not-working-for-3-6-10-installation/8509/2

@Cool-and-Deadly
Copy link

I can confirm. Same issue here with 3.6.10

@Cool-and-Deadly
Copy link

What would be the approach here? My Host updated PHP to 8.1 and now my app that is depending on the API is broken.

Does jms/serializer package need to be updated in jms/serializer-bundle ?

@michield
Copy link
Member

I recommend to downgrade to a version that works, and then we can review what needs to be done to fix this. Any suggestions are welcome.

@phpListDockerBot
Copy link
Contributor

This issue has been mentioned on phpList Discuss. There might be relevant details there:

https://discuss.phplist.org/t/newbie-trying-to-use-the-api/8787/2

@k-tatgenhorst
Copy link

In version 3.6.12 I can confirm this is not working and the freshly downloaded coded uses ReadOnly as an annotation.
A quick grep of the source (which could be an inflated count, as I am simply searching for the phrase ReadOnly and not the context) shows 244 instances of it being referenced.
I plan on changing this for my own install - should you wish it, would anyone have a renaming preference for that annotation? I imagine you still want it visually to indicate that this is a readonly attribute so my first thought would lean towards noWrite.

@k-tatgenhorst
Copy link

I think I read the first post too quickly. Never mind, I will update that portion of my install.

@k-tatgenhorst
Copy link

I went into the bases/vendor/jms/serializer-bundle directory and followed the instructions at this link:

https://jmsyst.com/bundles/JMSSerializerBundle

and then changed two references in the Driver file from ReadOnly to ReadOnlyProperty and I now have my installation of phplists exposing a functional API on php 8.2.

I will continue to watch my apache error logs and see if anythings needs updated. I did do a preliminary check of all deprecated calls for that upgrade and none appeared to be in use, so I believe the ReadOnlyProperty is the only relevant change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants