Yenxji
Active member
- Affected version
- 2.3.6
If you are trying to put
on template modification (Find) it can cause take a longer time to pop-up error:
But
works perfectly. This should prevent errors and longer time.
Following from this one: https://xenforo.com/community/threa...using-template-modification.55395/post-590423
and
@AndyB @Chris D @Jeremy P
Code:
/(.*?)/is
Code:
Server error log
[LIST]
[*]XF\Db\Exception: MySQL query error [1406]: Data too long for column 'template_parsed' at row 1
[*]src\XF\Db\AbstractStatement.php:230
[*]Generated by: Test
[*]Mar 14, 2025 at 2:04 PM
[/LIST]
[HEADING=2]Stack trace[/HEADING]
UPDATE `xf_template` SET `template_parsed` = ? WHERE `template_id` = 7560
------------
#0 src\XF\Db\Mysqli\Statement.php(207): XF\Db\AbstractStatement->getException('MySQL query err...', 1406, '22001')
#1 src\XF\Db\Mysqli\Statement.php(83): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1406, '22001')
#2 src\XF\Db\AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src\XF\Db\AbstractAdapter.php(323): XF\Db\AbstractAdapter->query('UPDATE `xf_tem...', Array)
#4 src\XF\Mvc\Entity\Entity.php(1577): XF\Db\AbstractAdapter->update('xf_template', Array, '`template_id` =...')
#5 src\XF\Mvc\Entity\Entity.php(1300): XF\Mvc\Entity\Entity->_saveToSource()
#6 src\XF\Entity\TemplateModification.php(101): XF\Mvc\Entity\Entity->save()
#7 src\XF\Entity\TemplateModification.php(157): XF\Entity\TemplateModification->reparseModification()
#8 src\XF\Mvc\Entity\Entity.php(1324): XF\Entity\TemplateModification->_postSave()
#9 src\XF\Mvc\FormAction.php(72): XF\Mvc\Entity\Entity->save(true, false)
#10 src\XF\Mvc\FormAction.php(190): XF\Mvc\FormAction->{closure:XF\Mvc\FormAction::saveEntity():70}(Object(XF\Mvc\FormAction))
#11 src\XF\Admin\Controller\TemplateModificationController.php(131): XF\Mvc\FormAction->run()
#12 src\XF\Mvc\Dispatcher.php(362): XF\Admin\Controller\TemplateModificationController->actionSave(Object(XF\Mvc\ParameterBag))
#13 src\XF\Mvc\Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:TemplateModi...', 'Save', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\TemplateModificationController), NULL)
#14 src\XF\Mvc\Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\TemplateModificationController), NULL)
#15 src\XF\Mvc\Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src\XF\App.php(2826): XF\Mvc\Dispatcher->run()
#17 src\XF.php(806): XF\App->run()
#18 admin.php(15): XF::runApp('XF\\Admin\\App')
#20 {main}
[HEADING=2]Request state[/HEADING]
array(4) {
["url"] => string(43) "/admin.php?template-modifications/1247/save"
["referrer"] => string(60) "http://domain.test/admin.php?template-modifications/1247/edit"
["_GET"] => array(1) {
["template-modifications/1247/save"] => string(0) ""
}
["_POST"] => array(14) {
["_xfToken"] => string(8) "********"
["type"] => string(6) "public"
["template"] => string(25) "xfrm_resource_add_chooser"
["modification_key"] => string(43) "test"
["description"] => string(44) "test"
["action"] => string(12) "preg_replace"
["find"] => string(9) "/(.*?)/is"
["replace"] => string(1694) "<xf:title>{{ phrase('xfrm_post_resource_in') }}</xf:title>
<div class="block">
</div>
But
Code:
/^.*$/s
Following from this one: https://xenforo.com/community/threa...using-template-modification.55395/post-590423
and
I use this to replace all content in a template:
Find: /^.*$/s
Replace: <xen:comment></xen:comment>
Find: /^.*$/s
Replace: <xen:comment></xen:comment>
@AndyB @Chris D @Jeremy P