Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

@@ -42,7 +42,10 @@ class UpdateHtmlPages extends QueueAbstract
*/
public function preQueueData( array $data ): ?array
{
$data['count'] = (int) Db::i()->select( 'count(page_id)', 'cms_pages' )->first();
$data['count'] = (int) Db::i()->select( 'count(page_id)', 'cms_pages', [
[ 'page_type=?', 'html' ],
[ 'page_id in (?)', Db::i()->select( 'database_page_id', 'cms_databases', 'database_page_id > 0' ) ]
] )->first();
return $data;
}
@@ -59,7 +62,10 @@ class UpdateHtmlPages extends QueueAbstract
$limit = REBUILD_SLOW;
$rows = iterator_to_array(
new ActiveRecordIterator(
Db::i()->select( '*', 'cms_pages', null, 'page_id', array( $offset, $limit ) ),
Db::i()->select( '*', 'cms_pages', [
[ 'page_type=?', 'html' ],
[ 'page_id in (?)', Db::i()->select( 'database_page_id', 'cms_databases', 'database_page_id > 0' ) ]
], 'page_id', array( $offset, $limit ) ),
Page::class
)
);
@@ -67,43 +73,25 @@ class UpdateHtmlPages extends QueueAbstract
$lang = Lang::load( Lang::defaultLanguage() );
foreach( $rows as $row )
{
/* Builder pages need minor adjustment */
if( $row->type == 'builder' )
{
$row->ipb_wrapper = true;
}
else
{
/* Convert the page to a builder page with a single column */
$area = Area::create( 'col1', [
[
'title' => $lang->addToStack( 'block_Codemirror' ),
'config' => true,
'blank' => false,
'app' => 'cms',
'key' => 'Codemirror',
'unique' => mt_rand(),
'configuration' => [
'content' => $row->content
]
/* Convert the page to a builder page with a single column */
$area = Area::create( 'col1', [
[
'title' => $lang->addToStack( 'block_Codemirror' ),
'config' => true,
'blank' => false,
'app' => 'cms',
'key' => 'Codemirror',
'unique' => mt_rand(),
'configuration' => [
'content' => $row->content
]
], [ 'wrapBehavior' => 'stack' ] );
$row->saveArea( $area );
$row->type = 'builder';
$row->content = null;
if( $row->wrapper_template === null or $row->wrapper_template == '__none__')
{
$row->ipb_wrapper = true;
}
}
if( $row->template == 'page_builder__single_column__page_page_builder_single_column' or $row->template == 'page_builder__single_column__page_builder_single_column' )
{
$row->template = null;
}
]
], [ 'wrapBehavior' => 'stack' ] );
$row->saveArea( $area );
$row->type = 'builder';
$row->content = null;
$row->ipb_wrapper = true;
$row->save();
}