Skip to content

Commit

Permalink
release 1.19 - last error (circular ref and the path given is not qua…
Browse files Browse the repository at this point in the history
…lified)
  • Loading branch information
gerardnico committed Sep 2, 2021
1 parent e8b2ff5 commit ba833f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 1 addition & 3 deletions action/historicalbreadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class action_plugin_combo_historicalbreadcrumb extends DokuWiki_Action_Plugin
{


const HISTORICAL_BREADCRUMB_NAME = "historical-breadcrumb";

public function register(Doku_Event_Handler $controller)
{

Expand Down Expand Up @@ -66,7 +64,7 @@ public function handle_breadcrumb_history(Doku_Event $event, $param)
/**
* Css
*/
PluginUtility::getSnippetManager()->attachCssSnippetForRequest(self::HISTORICAL_BREADCRUMB_NAME);
PluginUtility::getSnippetManager()->attachCssSnippetForRequest(HistoricalBreadcrumbMenuItem::HISTORICAL_BREADCRUMB_NAME);

array_splice($event->data['items'], -1, 0, array(new HistoricalBreadcrumbMenuItem()));

Expand Down
5 changes: 4 additions & 1 deletion class/DokuPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ protected function __construct($absolutePath, $type, $rev = null)
} else {

if (substr($absolutePath, 0, 1) != DokuPath::PATH_SEPARATOR) {
LogUtility::msg("The path given ($absolutePath) is not qualified", LogUtility::LVL_MSG_ERROR);
if(PluginUtility::isDevOrTest()) {
// Feel too much the log, test are not seeing anything, may be minimap ?
LogUtility::msg("The path given ($absolutePath) is not qualified", LogUtility::LVL_MSG_ERROR);
}
$this->absolutePath = ":" . $absolutePath;
}
$this->scheme = self::LOCAL_SCHEME;
Expand Down
9 changes: 7 additions & 2 deletions class/HistoricalBreadcrumbMenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace ComboStrap;

require_once('PluginUtility.php');

use dokuwiki\Menu\Item\AbstractItem;

Expand All @@ -30,6 +29,12 @@ class HistoricalBreadcrumbMenuItem extends AbstractItem

const RECENT_PAGES_VISITED = "Recent Pages Visited";

/**
* This unique name should not be in the {@link \action_plugin_combo_historicalbreadcrumb}
* to avoid circular reference
*/
const HISTORICAL_BREADCRUMB_NAME = "historical-breadcrumb";


/**
*
Expand Down Expand Up @@ -62,7 +67,7 @@ public function getLinkAttributes($classprefix = 'menuitem ')
*/
$actualPageId = array_keys($pages)[0];
$actualPageName = array_shift($pages);
$html = $this->createLink($actualPageId,$actualPageName,\action_plugin_combo_historicalbreadcrumb::HISTORICAL_BREADCRUMB_NAME."-home");
$html = $this->createLink($actualPageId,$actualPageName, self::HISTORICAL_BREADCRUMB_NAME ."-home");

$html .= '<ol>' . PHP_EOL;
foreach ($pages as $id => $name) {
Expand Down

0 comments on commit ba833f1

Please sign in to comment.