Fixed Infinite loop in TemplatePartialCompile

Xon

Well-known member
Licensed customer
Affected version
2.3.13
I had a report from a client that merging templates in the middle of XF doing a partial compile can cause a job to get stuck in an infinite loop.

The problem is if the template vanishes it tries to skip the that templateId but it does this without removing the template id from $this->data['templateIds'];
Code:
foreach ($this->data['templateIds'] AS $k => $templateId)
{
/** @var Template $template */
    $template = $this->app->find(Template::class, $templateId);
if (!$template)
    {
continue;
    }

A web job will time out eventually, and then restart from the same post and keep timing out. But run from the CLI it'll just keep going.
 
Also, that phpdoc type hint since find() should be type-hinted now from the input argument
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.14).

Change log:
Prevent template rebuilding from getting stuck after templates are deleted
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom