Skip to content

Commit 155e043

Browse files
authored
Merge pull request #112 from ticktackk/develop
Develop
2 parents f3a8dc4 + 854e917 commit 155e043

File tree

4 files changed

+31
-23
lines changed

4 files changed

+31
-23
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
==========================
33

4+
## 1.3.8 (`1030870`)
5+
6+
- **Fix:** `XF\Api\Templater` error message when calling API endpoints
7+
- **Fix:** Inability to save phrases via admin control panel
8+
49
## 1.3.7 (`1030770`)
510

611
- **Change:** On XF 2.2.7+ when minifying JS files go with the stock minifier service (#109)

Listener.php

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,31 @@ public static function dispatcherPostRender
4646

4747
/** @var ExtendedTemplater $templater */
4848
$templater = $renderer->getTemplater();
49-
$permissionErrors = $templater->getPermissionErrors();
50-
51-
if (count($permissionErrors))
49+
if (\is_callable([$templater, 'getPermissionErrors']))
5250
{
53-
$warningHtml = '<div class="blockMessage blockMessage--warning"><h2 style="margin: 0 0 .5em 0">Permission errors</h2><ul>';
54-
foreach ($permissionErrors AS $permissionError)
55-
{
56-
$warningHtml .= sprintf('<li>%s (%s:%d)</li>',
57-
htmlspecialchars($permissionError['error']),
58-
htmlspecialchars(FileUtil::stripRootPathPrefix($permissionError['file'])),
59-
$permissionError['line']
60-
);
61-
}
62-
$warningHtml .= '</ul></div>';
51+
$permissionErrors = $templater->getPermissionErrors();
6352

64-
if (strpos($content, '<!--XF:EXTRA_OUTPUT-->') !== false)
53+
if (count($permissionErrors))
6554
{
66-
$content = str_replace('<!--XF:EXTRA_OUTPUT-->', $warningHtml . '<!--XF:EXTRA_OUTPUT-->', $content);
67-
}
68-
else
69-
{
70-
$content = preg_replace('#<body[^>]*>#i', "\\0$warningHtml", $content);
55+
$warningHtml = '<div class="blockMessage blockMessage--warning"><h2 style="margin: 0 0 .5em 0">Permission errors</h2><ul>';
56+
foreach ($permissionErrors AS $permissionError)
57+
{
58+
$warningHtml .= sprintf('<li>%s (%s:%d)</li>',
59+
htmlspecialchars($permissionError['error']),
60+
htmlspecialchars(FileUtil::stripRootPathPrefix($permissionError['file'])),
61+
$permissionError['line']
62+
);
63+
}
64+
$warningHtml .= '</ul></div>';
65+
66+
if (strpos($content, '<!--XF:EXTRA_OUTPUT-->') !== false)
67+
{
68+
$content = str_replace('<!--XF:EXTRA_OUTPUT-->', $warningHtml . '<!--XF:EXTRA_OUTPUT-->', $content);
69+
}
70+
else
71+
{
72+
$content = preg_replace('#<body[^>]*>#i', "\\0$warningHtml", $content);
73+
}
7174
}
7275
}
7376
}

XF/Admin/Controller/Phrase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public function actionSave(ParameterBag $params)
5656
$db = $this->app()->db();
5757
$db->beginTransaction();
5858

59-
$reply = parent::actionSave($parameterBag);
59+
$reply = parent::actionSave($params);
6060

6161
/** @noinspection PhpUndefinedFieldInspection */
62-
if (!$parameterBag->phrase_id && $reply instanceof RedirectReply)
62+
if (!$params->phrase_id && $reply instanceof RedirectReply)
6363
{
6464
$phrases = $this->filter('phrases', 'array');
6565
if (count($phrases))

addon.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"legacy_addon_id": "",
33
"title": "Developer Tools",
44
"description": "This add-on provides enhancements for add-on developers.",
5-
"version_id": 1030770,
6-
"version_string": "1.3.7",
5+
"version_id": 1030870,
6+
"version_string": "1.3.8",
77
"dev": "TickTackk",
88
"dev_url": "https://xenforo.com/community/members/ticktackk.90375/",
99
"faq_url": "",

0 commit comments

Comments
 (0)