commit 964a7fb1346fbf84e26454dcf9c4ccbf89c80074
parent 2dfb136ad3bb96919647dda8385de4fee8f6a593
Author: Jan Dankert <devnull@localhost>
Date: Tue, 27 Nov 2018 22:43:28 +0100
Fix: Link auf das CMS korrigiert (darf nicht auf die API zeigen).
Diffstat:
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/modules/cms-core/model/Value.class.php b/modules/cms-core/model/Value.class.php
@@ -1408,6 +1408,11 @@ SQL
case 'edit_fullurl':
$raw = true;
$inhalt = Http::getServer();
+
+ // Der Link soll nicht auf die API, sondern auf das UI zeigen.
+ if ( substr($inhalt,-4) == 'api/' )
+ $inhalt = substr($inhalt,0,-4);
+
$db = \Session::getDatabase();
$params = array('dbid' =>$db->id,
'objectid' =>$this->page->objectid,
@@ -1498,13 +1503,10 @@ SQL
break;
default:
- // Unbekannte Elementtypen darf es nicht geben, daher ERROR loggen.
- Logger::error('element:'.$this->element->name.', '.
- 'unknown type:'.$this->element->type);
-
+ // Unbekannte Elementtypen darf es nicht geben.
if ( !$this->publish )
- $inhalt = lang('ERROR_IN_ELEMENT').' ('.$this->element->name.':'.
- 'unknown type:'.$this->element->type.')';
+ throw new \LogicException( lang('ERROR_IN_ELEMENT').' ('.$this->element->name.':'.
+ 'unknown type:'.$this->element->type.')');
}