Version 5.0.0 beta 10

This commit is contained in:
Neo committed 2025-12-19 17:53:48 -08:00
1 parent 56979f8ee8
commit 264eeb97e0
325 files changed
+6442 -1849

No files matched your search

@@ -613,6 +613,12 @@ class Category extends Model implements Permissions
Lang::deleteCustom( 'gallery', "gallery_category_{$this->id}_rulestitle" );
Lang::deleteCustom( 'gallery', "gallery_category_{$this->id}_rules" );
Lang::deleteCustom( 'gallery', "gallery_category_{$this->id}_permerror" );
/* Unclaim Attachments */
foreach( [ 'permerror', 'rules', 'description' ] as $id3 )
{
File::unclaimAttachments( 'gallery_Categories', $this->_id, null, $id3 );
}
}
/**
@@ -1002,6 +1008,23 @@ class Category extends Model implements Permissions
$oldLangKey = str_replace( $this->id, $oldId, $langKey );
Lang::saveCustom( 'gallery', $langKey, iterator_to_array( Db::i()->select( 'word_custom, lang_id', 'core_sys_lang_words', array( 'word_key=?', $oldLangKey ) )->setKeyField( 'lang_id' )->setValueField('word_custom') ) );
}
/* If the description had attachments, link them */
$attachmentMappings = [];
foreach( Db::i()->select( '*', 'core_attachments_map', [
[ 'location_key=?', 'gallery_Categories' ],
[ 'id1=?', $oldId ],
[ 'id2 is null' ],
[ Db::i()->in( 'id3', [ 'description', 'rules', 'permerror' ] ) ]
] ) as $attachment )
{
$attachment['id1'] = $this->_id;
$attachmentMappings[] = $attachment;
}
if( count( $attachmentMappings ) )
{
Db::i()->insert( 'core_attachments_map', $attachmentMappings );
}
}
/**