Fixed Entering phrases over 75 characters in admin template editor will trigger exception instead of error

tyteen4a03

Well-known member
Title. The original phrase was 83 characters long (by accident, of course)

Mysqli statement execute error : Data too long for column 'phrase_title' at row 1

Can't seem to copy all the traces so I'm just going to paste the html:
Code:
<ol class="traceHtml">
<li><b class="function">Zend_Db_Statement_Mysqli-&gt;_execute()</b> <span class="shade">in</span> <b class="file">*\library\Zend\Db\Statement.php</b> <span class="shade">at line</span> <b class="line">317</b></li>
<li><b class="function">Zend_Db_Statement-&gt;execute()</b> <span class="shade">in</span> <b class="file">*\library\Zend\Db\Adapter\Abstract.php</b> <span class="shade">at line</span> <b class="line">479</b></li>
<li><b class="function">Zend_Db_Adapter_Abstract-&gt;query()</b> <span class="shade">in</span> <b class="file">*\library\Zend\Db\Adapter\Abstract.php</b> <span class="shade">at line</span> <b class="line">574</b></li>
<li><b class="function">Zend_Db_Adapter_Abstract-&gt;insert()</b> <span class="shade">in</span> <b class="file">*\library\XenForo\Model\AdminTemplate.php</b> <span class="shade">at line</span> <b class="line">593</b></li>
<li><b class="function">XenForo_Model_AdminTemplate-&gt;compileParsedAdminTemplate()</b> <span class="shade">in</span> <b class="file">*\library\XenForo\DataWriter\AdminTemplate.php</b> <span class="shade">at line</span> <b class="line">227</b></li>
<li><b class="function">XenForo_DataWriter_AdminTemplate-&gt;_recompileTemplate()</b> <span class="shade">in</span> <b class="file">*\library\XenForo\DataWriter\AdminTemplate.php</b> <span class="shade">at line</span> <b class="line">207</b></li>
<li><b class="function">XenForo_DataWriter_AdminTemplate-&gt;_postSave()</b> <span class="shade">in</span> <b class="file">*\library\XenForo\DataWriter.php</b> <span class="shade">at line</span> <b class="line">1385</b></li>
<li><b class="function">XenForo_DataWriter-&gt;save()</b> <span class="shade">in</span> <b class="file">*\library\XenForo\ControllerAdmin\AdminTemplate.php</b> <span class="shade">at line</span> <b class="line">262</b></li>
<li><b class="function">XenForo_ControllerAdmin_AdminTemplate-&gt;actionSaveMultiple()</b> <span class="shade">in</span> <b class="file">*\library\XenForo\FrontController.php</b> <span class="shade">at line</span> <b class="line">310</b></li>
<li><b class="function">XenForo_FrontController-&gt;dispatch()</b> <span class="shade">in</span> <b class="file">*\library\XenForo\FrontController.php</b> <span class="shade">at line</span> <b class="line">132</b></li>
<li><b class="function">XenForo_FrontController-&gt;run()</b> <span class="shade">in</span> <b class="file">*\admin.php</b> <span class="shade">at line</span> <b class="line">13</b></li>
</ol>
 
Do you *have* phrases with titles more than 75 characters? The phrase table doesn't *allow* titles > 75 characters to begin with.
No, since it wouldn't allow through. However, when saving a template with a phrase name that long, it should warn me instead of throwing this error.
 
Wouldn't it make more sense to create the phrase before saving it anyway? If for no other reason for sake of efficiency... otherwise you need to go back and compile the template again when the phrase is edited/added after the fact.
 
Wouldn't it make more sense to create the phrase before saving it anyway? If for no other reason for sake of efficiency... otherwise you need to go back and compile the template again when the phrase is edited/added after the fact.
For me I work the other way - I decide which phrase to add in the template, save once, then add the phrases and see the effect.
 
Fixed. For DP's reference, this happened when you had a {xen:phrase ...} tag where the phrase name was too long. It keeps the phrase name in a table so when you edit a phrase it knows what needs to be recompiled. That phrase doesn't need to already exist (unlike template includes).
 
Back
Top Bottom