backdrop-contrib / paragraphs

Paragraphs module to control your content flow
https://backdropcms.org/project/paragraphs
GNU General Public License v2.0
5 stars 11 forks source link

Possible Ajax issues after adding several paragraphs, cannot select file from server for image field #69

Closed kelizoliva closed 2 years ago

kelizoliva commented 4 years ago

For a project, we are trying to use Paragraphs 1.x-1.1.0-beta.

I have not been able to definitively determine the source(s) of this bug, but after adding several paragraphs to a page and saving, editing the content again to add more paragraph items has some very unpredictable issues that might relate to Ajax, but might not (the issues are really bizarre and not producing useful errors in the logs).

Steps to reproduce:

  1. 3 paragraph types, one of which includes an image field.
  2. Creating a new node which contains image field, body field, and paragraphs field
  3. Adding an image and text to the image and body fields, followed by a save, works as expected without an issue. For the image field, image is selected from existing media on the server.
  4. Editing again and adding a few paragraphs, specifically the paragraph that includes an image field. Adding one at a time and saving between each. No issues. (did this around 4 times)
  5. Editing again and adding a paragraph of a different style (title, text field, body field), saves without issue.
  6. Editing again and adding a paragraph of the style that includes an image field (again), except this time the 'select existing file' button does not load the modal. Tried a few times to click the button, no luck. Uploading image does work. Node saves without issue.
  7. Subsequent attempts to add images to new paragraphs from server fails in the same way.
  8. For paragraphs with images that had previously been successfully added, I was able to remove the image and add another from the server with no issue. Was subsequently able to save with no issue.
  9. Editing the node again, I deleted the last successful paragraph created that contained an image selected from server, and saved without issue.
  10. Editing the node again, I was able to successfully add a paragraph with an image selected from the server. I was then able to save the node successfully.
  11. Editing the node again, I added another paragraph but was unable to select an image from the server.

The total number of paragraph items (in the style that includes an image) that I was able to successfully implement on the node was 3. I was not able to trigger any errors in the logs, nor in the browser console.

There are also issues that come up with saving after adding a lot of paragraphs (which also seems to relate to ajax), but I'm not sure to what degree it relates to the experience above, so leaving that off of this issue for now.

I will keep testing this and add any additional relevant information, but wanted to get this posted in case anyone has experienced anything similar with the module.

kelizoliva commented 4 years ago

I was overlooking an alert in the console every time I looked at it for whatever reason. I blame the pandemic. Yeah.

So here is the alert:

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.

At first it seemed benign because it does show up even for successful requests, but then I searched on the warning and came across this thread , so I am wondering if perhaps some tweaks just need to be made to the way Ajax requests are being run? Not sure if this is specific to paragraphs, or actually a wider Backdrop issue.

kelizoliva commented 4 years ago

I also see that the modal is a wip on this issue, so hunting over there now to see if anything of this sort has been documented.

laryn commented 4 years ago

Can't dig into this in depth right now, but do these help you at all?

I think the PR you link in the previous comment is outdated (a separate PR was merged).

kelizoliva commented 4 years ago

Thanks Laryn! I am just trying to grasp ajax behaviors a bit better. I still have not been able to ascertain the source of the suspected bug we are experiencing, as there are no errors in the console or logs that definitively point to anything that would help explain the modal box not opening. And I am not even sure it necessarily has anything directly to do with this module, vs a core issue with the way the file browser is loaded.

And yes, after taking a closer look, it appears this is the actual PR that was merged?

laryn commented 2 years ago

Is this still an issue @kelizoliva -- and if so do you have STR on a vanilla site with Paragraphs installed?

laryn commented 2 years ago

I'm going to close this for now. Feel free to reopen if you are still seeing this on the latest version and have steps to reproduce, of course!