1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 17:24:46 +02:00
This commit is contained in:
Ryan Cramer
2022-05-27 11:00:58 -04:00
parent 2cf811f76c
commit f0bc888355

View File

@@ -1539,12 +1539,13 @@ abstract class Fieldtype extends WireData implements Module {
* *
*/ */
public function get($key) { public function get($key) {
if($key == 'name') return $this->className(); if($key === 'name') return $this->className();
if($key == 'shortName') { if($key === 'shortName') {
return str_replace('Fieldtype', '', $this->className()); return str_replace('Fieldtype', '', $this->className());
} else if($key == 'longName' && method_exists($this, 'getModuleInfo')) { } else if($key === 'longName') {
$info = $this->getModuleInfo($this); $title = $this->wire()->modules->getModuleInfoProperty($this, 'title');
return $info['title']; if(empty($title)) $title = $this->get('shortName');
return $title;
} }
return parent::get($key); return parent::get($key);
} }