Sonya* Posted January 12, 2022 Share Posted January 12, 2022 In CMS Templates, when I try to create a new group for JS Files I get the error: This template group already exists. The template group does not exist, though. At least not in JS files. There is indeed a template group with the same name in CSS files. In applications/cms/modules/admin/pages/templates.php line 615 you check if the group exists without checking template_location: $form->add( new \IPS\Helpers\Form\Text( 'template_group_new', NULL, FALSE, array( 'regex' => '/^([a-z_][a-z0-9_]+?)?$/' ), function( $val ) { try { $count = \IPS\Db::i()->select( 'COUNT(*)', 'cms_templates', array( "LOWER(template_group)=?", mb_strtolower( str_replace( ' ', '_', $val ) ) ) )->first(); if ( $count ) { throw new \DomainException( 'cms_template_group_exists' ); } } catch( \UnderflowException $e ) {} }, NULL, NULL, 'group_new' ) ); $count returns 1 even if the template group exists in Pages or CSS. Additional WHERE on cms_templates.template_location is required or the error message should inform that you can only ONE template group with the same name across the entire suite. Link to comment Share on other sites More sharing options...
Solution Daniel F Posted January 18, 2022 Solution Share Posted January 18, 2022 Thanks, I have moved this to our bug tracker. Sonya* 1 Link to comment Share on other sites More sharing options...
Recommended Posts