mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 02:04:35 +02:00
Fix issue processwire/processwire-issues#818 where listable but not editable or viewable page in dropdown for Pages > Tree > [items] was navigating to some useless JSON output. Also disabled the fallback to view URL when page is viewable but not editable.
This commit is contained in:
@@ -544,7 +544,8 @@ class ProcessPageList extends Process implements ConfigurableModule {
|
|||||||
$url = $page->editUrl();
|
$url = $page->editUrl();
|
||||||
$editable = true;
|
$editable = true;
|
||||||
} else if($page->viewable()) {
|
} else if($page->viewable()) {
|
||||||
$url = $page->url();
|
// do not show view URLs per #818
|
||||||
|
// $url = $page->url();
|
||||||
}
|
}
|
||||||
|
|
||||||
$numChildren = $id > 1 ? $renderer->numChildren($page) : 0;
|
$numChildren = $id > 1 ? $renderer->numChildren($page) : 0;
|
||||||
|
@@ -337,13 +337,17 @@ var ProcessWireAdmin = {
|
|||||||
|
|
||||||
if(this.url == 'navJSON') {
|
if(this.url == 'navJSON') {
|
||||||
// click triggers another navJSON load
|
// click triggers another navJSON load
|
||||||
} else {
|
} else if(this.url.indexOf('/') === 0) {
|
||||||
var url = this.url.indexOf('/') === 0 ? this.url : data.url + this.url;
|
url = this.url;
|
||||||
|
} else if(this.url.length) {
|
||||||
|
url = data.url + this.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $li = $("<li class='ui-menu-item'></li>");
|
var $li = $("<li class='ui-menu-item'></li>");
|
||||||
var $a = $("<a href='" + url + "'>" + icon + this.label + "</a>");
|
var $a = $("<a>" + icon + this.label + "</a>");
|
||||||
var $ulSub = null;
|
var $ulSub = null;
|
||||||
|
|
||||||
|
if(url.length) $a.attr('href', url);
|
||||||
|
|
||||||
if(this.navJSON) {
|
if(this.navJSON) {
|
||||||
$a.attr('data-json', this.navJSON).addClass('pw-has-items pw-has-ajax-items');
|
$a.attr('data-json', this.navJSON).addClass('pw-has-items pw-has-ajax-items');
|
||||||
|
2
wire/templates-admin/scripts/main.min.js
vendored
2
wire/templates-admin/scripts/main.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user