mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
BUGFIX: Links to CMS edit page fails when the link includes ?locale=en_NZ or similar
This commit is contained in:
parent
613ad1cb60
commit
69896840cb
@ -43,12 +43,15 @@ class PagesDueForReviewReport extends SS_Report {
|
||||
*/
|
||||
public function columns() {
|
||||
|
||||
$linkBase = singleton('CMSPageEditController')->Link('show') . '/';
|
||||
$linkBase = singleton('CMSPageEditController')->Link('show');
|
||||
$linkPath = parse_url($linkBase, PHP_URL_PATH);
|
||||
$linkQuery = parse_url($linkBase, PHP_URL_QUERY);
|
||||
|
||||
|
||||
$fields = array(
|
||||
'Title' => array(
|
||||
'title' => 'Page name',
|
||||
'formatting' => '<a href=\"' . $linkBase . '/$ID\" title=\"Edit page\">$value</a>'
|
||||
'formatting' => sprintf('<a href=\"%s/$ID?%s\" title=\"Edit page\">$value</a>', $linkPath, $linkQuery)
|
||||
),
|
||||
'NextReviewDate' => array(
|
||||
'title' => 'Review Date',
|
||||
@ -85,13 +88,19 @@ class PagesDueForReviewReport extends SS_Report {
|
||||
),
|
||||
'ContentReviewType' => array(
|
||||
'title' => 'Settings are',
|
||||
'formatting' => function($value, $item) use($linkBase) {
|
||||
'formatting' => function($value, $item) use($linkPath, $linkQuery) {
|
||||
if($item->ContentReviewType == 'Inherit') {
|
||||
$options = $item->getOptions();
|
||||
if($options && $options instanceof SiteConfig) {
|
||||
return 'Inherited from <a href="admin/settings">Settings</a>';
|
||||
} elseif($options) {
|
||||
return 'Inherited from <a href="'.$linkBase.$options->ID.'">'.$options->Title.'</a>';
|
||||
return sprintf(
|
||||
'Inherited from <a href="%s/%d?%s">%s</a>',
|
||||
$linkPath,
|
||||
$options->ID,
|
||||
$linkQuery,
|
||||
$options->Title
|
||||
);
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
|
@ -31,11 +31,14 @@ class PagesWithoutReviewScheduleReport extends SS_Report {
|
||||
* @return array
|
||||
*/
|
||||
public function columns() {
|
||||
$linkBase = singleton('CMSPageEditController')->Link('show') . '/';
|
||||
$linkBase = singleton('CMSPageEditController')->Link('show');
|
||||
$linkPath = parse_url($linkBase, PHP_URL_PATH);
|
||||
$linkQuery = parse_url($linkBase, PHP_URL_QUERY);
|
||||
|
||||
$fields = array(
|
||||
'Title' => array(
|
||||
'title' => 'Page name',
|
||||
'formatting' => '<a href=\"' . $linkBase . '/$ID\" title=\"Edit page\">$value</a>'
|
||||
'formatting' => sprintf('<a href=\"%s/$ID?%s\" title=\"Edit page\">$value</a>', $linkPath, $linkQuery)
|
||||
),
|
||||
'NextReviewDate' => array(
|
||||
'title' => 'Review Date',
|
||||
@ -59,13 +62,19 @@ class PagesWithoutReviewScheduleReport extends SS_Report {
|
||||
),
|
||||
'ContentReviewType' => array(
|
||||
'title' => 'Settings are',
|
||||
'formatting' => function($value, $item) use($linkBase) {
|
||||
'formatting' => function($value, $item) use($linkPath, $linkQuery) {
|
||||
if($item->ContentReviewType == 'Inherit') {
|
||||
$options = $item->getOptions();
|
||||
if($options && $options instanceof SiteConfig) {
|
||||
return 'Inherited from <a href="admin/settings">Settings</a>';
|
||||
} elseif($options) {
|
||||
return 'Inherited from <a href="'.$linkBase.$options->ID.'">'.$options->Title.'</a>';
|
||||
return sprintf(
|
||||
'Inherited from <a href="%s/%d?%s">%s</a>',
|
||||
$linkPath,
|
||||
$options->ID,
|
||||
$linkQuery,
|
||||
$options->Title
|
||||
);
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
|
Loading…
Reference in New Issue
Block a user