Bug: Gridbox page editor serializes client-side generated DOM elements into saved content, breaking dynamic modules.

Dear Balbooa team,

Two of our team members have spent the entire day investigating why a specific page was generating DIV elements not represented within the page builder.

Our custom code is designed to create a DIV under a specific class, which we have inserted into the page builder. This code executes from a Joomla module that runs via Joomla on specific pages (not added via Gridbox).

We discovered that when this code (using the default jQuery prepend method) runs inside the editor, the editor saves the prepended elements directly to the database #__gridbox_pages.

This was completely unexpected. Even after disabling the module, the prepended items remained visible. We initially suspected caching, but there is no active cache on this development site; neither browser nor server-side. We tried multiple browsers and every anti-caching measure available, but the issue persisted.

Ultimately, just before the end of the workday, we checked the database and found the cause.

- 1 match in #__modules, which is expected as it is our custom module inserting the DIV.
- 5 matches in #__gridbox_pages, which should never happen. We have no idea how Gridbox is saving dynamically created elements to the database; this appears to be a significant bug.

During today’s testing, we also added the section containing the DIVs to the library, and now there is also 1 match in #__gridbox_library.

We consider this a serious bug in Gridbox: it should not save dynamically injected DIVs from a Joomla custom module into the database. If this behavior is intentional and considered a feature, please explain its benefits, as we do not see any.

To illustrate: if you load an external calendar for May 2025, it should not remain stuck on May 2025 in December simply because the data was hard-saved in the database. Modules should always load content dynamically.

To provide more information, our code injector (the module) would run code like:

$('.class-of-div').prepend('Content here');

If we load the editor when the module is active in the editor it adds this .new-div to the DOM.
When we save this .new-div is also saved to the DB
When we reload the page it adds a .new-div on save we now have twice .new-div in the database for that page.

Yes, we made the mistake of not adding the check does this DIV already exist do not create a new one, but hey we are in development and errors are allowed to be made.

With regards,
LoginSecure, Elmer

Replies are visible only to logged in members with an active subscription.