mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 01:04:16 +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) {
|
||||
if($key == 'name') return $this->className();
|
||||
if($key == 'shortName') {
|
||||
if($key === 'name') return $this->className();
|
||||
if($key === 'shortName') {
|
||||
return str_replace('Fieldtype', '', $this->className());
|
||||
} else if($key == 'longName' && method_exists($this, 'getModuleInfo')) {
|
||||
$info = $this->getModuleInfo($this);
|
||||
return $info['title'];
|
||||
} else if($key === 'longName') {
|
||||
$title = $this->wire()->modules->getModuleInfoProperty($this, 'title');
|
||||
if(empty($title)) $title = $this->get('shortName');
|
||||
return $title;
|
||||
}
|
||||
return parent::get($key);
|
||||
}
|
||||
|
Reference in New Issue
Block a user