User tests: Successful: Unsuccessful:
Pull Request for Issue #35633 .
This pull request (PR) changes the look up for TinyMCE templates so that it doesn't use anymore a single "glob" call using the "GLOB_BRACE" flag.
See https://www.php.net/manual/en/function.glob.php :
Note: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris or Alpine Linux.
The use of that flag had been introduced with PR #33130 , so we don't have that issue in Joomla 3.
In addition to the above fix, this PR remove a redundant call to Factory::getLanguage()
from inside the foreach loop. The language object is already fetched here https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/editors/tinymce/tinymce.php#L178 in the same routine and later not modified, so it can be used.
Use the TinyMCE editor on a Joomla 4 installation on an operating system which doesn't support the "GLOB_BRACE" flag, like e.g. Alpine Linux.
Check if PR #33130 still works by testing as described in that PR.
See issue #35633 : error 0: Undefined constant "GLOB_BRACE"
.
Cannot be tested if you have error 1.
No errors, all works fine.
The test from PR #33130 works as it should.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
@richard67 can I ask a change here? Can we be more functional here:
array_map(function ($suffix) use (&$template_path) {
foreach (glob(JPATH_ROOT . $template_path . '/*.' . $suffix) as $filepath) {
$fileinfo = pathinfo($filepath);
$filename = $fileinfo['filename'];
$full_filename = $fileinfo['basename'];
if ($filename === 'index') {
continue;
}
$lang = Factory::getLanguage();
$title = $filename;
$title_upper = strtoupper($filename);
$description = ' ';
if ($lang->hasKey('PLG_TINY_TEMPLATE_' . $title_upper . '_TITLE')) {
$title = Text::_('PLG_TINY_TEMPLATE_' . $title_upper . '_TITLE');
}
if ($lang->hasKey('PLG_TINY_TEMPLATE_' . $title_upper . '_DESC')) {
$description = Text::_('PLG_TINY_TEMPLATE_' . $title_upper . '_DESC');
}
$templates[] = array(
'title' => $title,
'description' => $description,
'url' => Uri::root(true) . $template_path . '/' . $full_filename,
);
}
}, ['html', 'txt']);
it PHP not JS, it is fine as it is ;)
Labels |
Added:
?
|
@joeforjoomla Could you test again? I had to modify my code a bit. Thanks in advance.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-09-27 11:04:27 |
Closed_By | ⇒ | bembelimen | |
Labels |
Added:
?
|
Thx
I have tested this item✅ successfully on d1a9820
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35636.