[ExtendedProfile] Fix misuse of XMLOutputter
Argument 1 passed to xmloutputter::text() must be of the type string, null given, called in /srv/gnusocial/plugins/ExtendedProfile/lib/extendedprofilewidget.php on line 556
This commit is contained in:
parent
58af4799ee
commit
80a4811539
|
@ -84,12 +84,12 @@ class ExtendedProfile
|
||||||
* @param string $name name of the detail field to get the
|
* @param string $name name of the detail field to get the
|
||||||
* value from
|
* value from
|
||||||
*
|
*
|
||||||
* @return string the value
|
* @return string|null the value, null if none
|
||||||
*/
|
*/
|
||||||
public function getTextValue($name)
|
public function getTextValue($name): ?string
|
||||||
{
|
{
|
||||||
$key = strtolower($name);
|
$key = strtolower($name);
|
||||||
$profileFields = array('fullname', 'location', 'bio');
|
$profileFields = ['fullname', 'location', 'bio'];
|
||||||
|
|
||||||
if (in_array($key, $profileFields)) {
|
if (in_array($key, $profileFields)) {
|
||||||
return $this->profile->$name;
|
return $this->profile->$name;
|
||||||
|
|
|
@ -553,7 +553,7 @@ class ExtendedProfileWidget extends Form
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
case 'person':
|
case 'person':
|
||||||
$this->out->text($this->ext->getTextValue($name));
|
$this->out->text($this->ext->getTextValue($name) ?? '');
|
||||||
break;
|
break;
|
||||||
case 'custom-text':
|
case 'custom-text':
|
||||||
case 'custom-textarea':
|
case 'custom-textarea':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user