endorphinum21929
endorphinum21929

I have a partial where i via random want to show an image. The image data is saved in an PHP array and everthing works fine as long as there are not many items in it. But now i reached the point that when i want to save my partial, the "saving" animation starts for a second and finishes without saving the article. I even do not get the "Template saved" green alert. As soon as i remove my array, everthing works as expected.

I am absolutely no PHP expert, but for me it looks more like a memory error on my shared host. I think so, as the error that i do get inside an alert modal is this:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>503 Service Unavailable</title> </head><body> <h1>Service Unavailable</h1> <p>The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</p> <p>Additionally, a 304 Not Modified error was encountered while trying to use an ErrorDocument to handle the request.</p> </body></html>

My array looks like this (shortend): $arrImages = array( array( "name" => "Andrea Maggiore", "image" => "andrea_maggiore-1", "url" => "https://unsplash.com/@andreamaggiore3" ), array( "name" => "Chelsey Horne", "image" => "chelsey_horne-1", "url" => "https://www.pexels.com/de-de/@introspectivedsgn" ) .....

The event log in the backend also shows no error. Would be nice if someone of you could confirm to me that my array is taking too much memory and that i must change my solution.

endorphinum21929
endorphinum21929

[UPDATE] I went a step further and thought to myself that i am going to implement the whole JSON array in a TWIG key/hash array. Guess what: from the beginning i was not able to save the partial.

I then thought that the URLs of each artist inside the JSON object might be too long (for whatever reason). so i removed the https:// and as i saw that some of them had the @ sign inside, i also removed these. The result: i am again able to save the partial. As soon as the JSON object contains an AT sign or the http reference, i am not able to save my partial. Have i missed something on the OctoberCMS docs?

Hugs and greetings ppl!

netsmertia
netsmertia

If you were unable to save the partial or page from octobercms backend then this can be an issue of ModSecurity. I had faced this when my page contains the <form> tag. Not sure just a thought.

endorphinum21929
endorphinum21929

netsmertia said:

If you were unable to save the partial or page from octobercms backend then this can be an issue of ModSecurity. I had faced this when my page contains the <form> tag. Not sure just a thought.

Absolutly strange but thanks for the hint, will check that! Greetings and a good night

1-4 of 4