Environment
- SP Page Builder Pro 6.9.1
- Joomla 5.4.9, PHP 8.3, MySQL 8.4
- Site upgraded over several SP Page Builder major versions
The problem
Each row in #__sppagebuilder carries two copies of a page's layout:
content: the current layout JSONtext: an older layout format kept from earlier versions
On our homepage the two are different layouts: content is ~135 KB with 13 sections and is what actually renders; text is ~62 KB with an older 9-section version of the page.
Where the legacy column is still read for nothing:
- Page view:
components/com_sppagebuilder/models/page.php,getItem(), selects the whole row (a.*, so bothcontentandtext) and then immediately overwrites$data->textwith$data->contentwhencontentis not empty. The legacytextvalue is read from the database and discarded on every page view. - Hit counter:
models/page.php,hit(), calls$table->load($pk), which loads the entire row a second time (both layouts and the CSS) just to incrementhits(see our separate hit-counter report). - Articles addon: the per-article layout lookup in
helpers/articles.phpselectscontent,textandcssfor each listed article.
That means every view of our homepage reads ~62 KB of layout data that is never used, and the full ~193 KB row twice. Every page and article on sites upgraded from older versions likely carries a stale text copy too.
Suggested fix
- Load only what's needed: select
content(andcss) explicitly instead ofa.*, and readtextonly as a fallback whencontentis empty (i.e. for layouts that were never migrated). Don't reload the full row inhit(). - Finish the migration: once a row has a valid
contentlayout, clear or archive its legacytextvalue (for example in an update script, or the next time the page is saved in the editor), so stale copies don't linger and can't be confused with the live layout. - Optionally, show in the editor or page list when a page still relies on the legacy
textformat.
Impact
Small per request, but it's paid on every page view, and per listed article in Articles blocks, so it adds up on busy sites. It also removes the confusion of having two different versions of the same page stored side by side.