Skip to content

Commit

Permalink
JavaScript source regenerated every time the BBCode editor is shown #…
Browse files Browse the repository at this point in the history
  • Loading branch information
810 committed Sep 17, 2016
1 parent d4c2b6c commit 6c22eec
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
Expand Up @@ -556,6 +556,9 @@ public function save($key = null, $urlVar = null)
)
);

$editor = KunenaBbcodeEditor::getInstance();
$editor->initializeHMVC();

// Redirect the user and adjust session state based on the chosen task.
switch ($task)
{
Expand Down
20 changes: 20 additions & 0 deletions src/administrator/components/com_kunena/controllers/plugins.php
Expand Up @@ -136,6 +136,9 @@ public function publish()
}
}

$editor = KunenaBbcodeEditor::getInstance();
$editor->initializeHMVC();

$extension = $this->input->get('extension');
$extensionURL = ($extension) ? '&extension=' . $extension : '';
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $extensionURL, false));
Expand Down Expand Up @@ -248,11 +251,28 @@ public function checkin()
}
else
{
$editor = KunenaBbcodeEditor::getInstance();
$editor->initializeHMVC();

// Checkin succeeded.
$message = JText::plural($this->text_prefix . '_N_ITEMS_CHECKED_IN', count($ids));
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message);

return true;
}
}

/**
* Regenerate editor file
*
* @since 5.0.2
*/
public function resync()
{
$editor = KunenaBbcodeEditor::getInstance();
$editor->initializeHMVC();

$message = 'Sync done';
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message);
}
}
Expand Up @@ -66,6 +66,8 @@ protected function setToolbar()
JToolbarHelper::divider();
JToolbarHelper::checkin('checkin');
JToolbarHelper::spacer();
JToolbarHelper::custom('resync', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false);
JToolbarHelper::spacer();
$help_url = 'https://www.kunena.org/docs/';
JToolBarHelper::help('COM_KUNENA', false, $help_url);
}
Expand Down
5 changes: 0 additions & 5 deletions src/libraries/kunena/bbcode/editor.php
Expand Up @@ -173,11 +173,6 @@ public function initialize()
$template = KunenaFactory::getTemplate();

$this->isHMVC = $template->isHmvc();

if ($this->isHMVC)
{
$this->initializeHMVC();
}
}

/**
Expand Down

0 comments on commit 6c22eec

Please sign in to comment.