-
Notifications
You must be signed in to change notification settings - Fork 37
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
ErrorException: Array to string conversion #17
Comments
It might have something to do with multisite. My Craft install has 4 sites. When I changed the field type from oEmbed to Plain Text, this is what the plain text contained: Seems to me that the json is wrapped inside itself four times. However, when I have a look at the |
When I manually fix the json-data in the database, this "wrapping" happens again immediately when I try to change propagation method on the said section. I ended up changing oEmbed to a Plain Text field and fixing the data back to plain text by running the following SQLs -- Detect wraps
SELECT field_videoUrl FROM customer_automasjon_craft.content
where field_videoUrl like '{\"url\":{\"url\"%';
-- Remove 2x (just run this as many times as you believe you have duplicates/wraps)
update content set field_videoUrl = replace(field_videoUrl, '{\"url\":{\"url\":', '{\"url\":')
where field_videoUrl like '{\"url\":{\"url\"%';
update content set field_videoUrl = replace(field_videoUrl, '}}', '}')
where field_videoUrl like '%}}';
-- Convert all oEmbeds to plain text
update content set field_videoUrl = replace(field_videoUrl, '{\"url\":\"', '')
where field_videoUrl like '{\"url\":%';
update content set field_videoUrl = replace(field_videoUrl, '\"}', '')
where field_videoUrl like '%}'; After I had converted the fields to plaintext and removed traces of the JSON-wrapping, the queued jobs went green. So this is a fix to make due without the oEmbed-field while we wait for a fix to the bug. |
@nitech I'm gonna look into this issue as I also run a multi-sites with the plugin and haven't come the issue yet but currently in the process of a migration to CraftCMS v3.2, which the issue might be happening. |
@nitech I think this is an issue with the |
… logs in Neo. Issue seems to be 5th+ level objects not being covered for the legacy hardcoded string <-> array check/ converting.
@nitech can you try checking out the If not let me know and I'll keep on it for you. |
Thanks @reganlawton . I will check it when I have the possibility. Right now I am deep into another problem that occurred when upgrading Craft CMS to 3.2 (neo-field duplicated content problem at spicywebau/craft-neo#242) When I have that sorted out, I will test oEmbed at the mentioned branch. You asked about an URL for the site - but I see you've removed the question from your comment. Just tell me if you need anything more. In the meanwhile, while I work on the issue with the Neo-field - If it helps you, I can give you a copy of the database. Just give me an email and it'll be on it's way. |
I missed the Link in the above messages so amended my question. The note that you had 5 level deep objects kinda stood out and was I issue I believed I’d patched but must never had pushed. It also explains the array to string issue. So I’m hoping the recursive function being, well recursive, should resolve it. I also have additional work for CraftCMS 3.2 future version coming that’ll add Unit Testing to the plugin which should help cover these issues in the future. |
@nitech Any luck testing this? |
Deployed fix in v1.1.8 |
Sorry that I did not get to try it before you deployed. Great work Regan :-) |
Did it resolve your error? |
When I change the propagation method on an section, I get this error inside queue.log - and Craft will attempt rerunning the job over and over again:
The entries of this section are propagated with the option "Save entries to all sites enabled for this section"
Craft CMS Version: 3.2.9
oEmbed Version: 1.1.6
Neo Version: 2.4.2
Multisite: Yes, four sites.
The text was updated successfully, but these errors were encountered: