diff --git a/src/view/phui/PHUIObjectItemView.php b/src/view/phui/PHUIObjectItemView.php --- a/src/view/phui/PHUIObjectItemView.php +++ b/src/view/phui/PHUIObjectItemView.php @@ -83,11 +83,34 @@ return $this->object; } + /** + * Set the href attribute + * + * @param string|PhutilURI|null $href + * @return self + */ public function setHref($href) { + + // We have not a very clear idea about what this method should receive + // We suspect that PhutilURI should be allowed... but let's log everything! + // https://we.phorge.it/T15316 + if (is_object($href) && !($href instanceof PhutilURI)) { + phlog(sprintf( + 'Received unexpected type for href: %s. '. + 'Please paste this log as comment in https://we.phorge.it/T15316', + get_class($href))); + } + $this->href = $href; return $this; } + /** + * Get the href attribute + * + * @see PHUIObjectItemView::setHref() + * @return string|PhutilURI|null + */ public function getHref() { return $this->href; } @@ -136,7 +159,24 @@ return $this; } + /** + * Set the image href attribute + * + * @param string|PhutilURI|null $image_href + * @return self + */ public function setImageHref($image_href) { + + // We have not a very clear idea about what this method should receive + // We suspect that PhutilURI should be allowed... but let's log everything! + // https://we.phorge.it/T15316 + if (is_object($image_href) && !($image_href instanceof PhutilURI)) { + phlog(sprintf( + 'Received unexpected type for imageHref: %s. '. + 'Please paste this log as comment in https://we.phorge.it/T15316', + get_class($image_href))); + } + $this->imageHref = $image_href; return $this; } @@ -659,8 +699,8 @@ $this->getImageIcon()); } - if ($image && (phutil_nonempty_string($this->href) || - phutil_nonempty_string($this->imageHref))) { + if ($image && (phutil_nonempty_stringlike($this->href) || + phutil_nonempty_stringlike($this->imageHref))) { $image_href = ($this->imageHref) ? $this->imageHref : $this->href; $image = phutil_tag( 'a',