From 0bff314daa1384f9ea9b86dc1b09c61463df2a2f Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Thu, 11 Jul 2013 15:00:23 +1000 Subject: [PATCH] MDL-40621 fixed small bug in function editor_tinymce_plugin::fix_row() --- lib/editor/tinymce/classes/plugin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/editor/tinymce/classes/plugin.php b/lib/editor/tinymce/classes/plugin.php index 35fe4f2a3ed..349673adb37 100644 --- a/lib/editor/tinymce/classes/plugin.php +++ b/lib/editor/tinymce/classes/plugin.php @@ -198,7 +198,7 @@ abstract class editor_tinymce_plugin { * @param int $row Row to add button to (1 to 10) * @param string $button Identifier of button/plugin * @param string $before Adds button directly before the named plugin - * @param bool $alwaysadd If specified $after string not found, add at start + * @param bool $alwaysadd If specified $before string not found, add at start * @return bool True if added */ protected function add_button_before(array &$params, $row, $button, @@ -218,7 +218,7 @@ abstract class editor_tinymce_plugin { return true; } - // Try to add after given plugin. + // Try to add before given plugin. $params[$field] = preg_replace('~(,|^)(' . preg_quote($before) . ')(,|$)~', '$1' . $button . ',$2$3', $old); if ($params[$field] !== $old) { @@ -270,8 +270,9 @@ abstract class editor_tinymce_plugin { return $row; } for($i=$row; $i>=1; $i--) { + $field = 'theme_advanced_buttons' . $i; if (isset($params[$field])) { - return $row; + return $i; } } // This should not happen. -- 2.43.0