mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 17:24:46 +02:00
Fix issue processwire/processwire-issues#1576
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user