$item["entry:cid"] = defaults($item, "entry:cid", 0);
$entry = self::entry($doc, "text", $item, $owner, $item["entry:comment-allow"], $item["entry:cid"]);
- $root->appendChild($entry);
+ if (isset($entry)) {
+ $root->appendChild($entry);
+ }
}
return trim($doc->saveXML());
}
$entry = self::entry($doc, $type, $item, $owner, true);
- $root->appendChild($entry);
+ if (isset($entry)) {
+ $root->appendChild($entry);
+ }
}
$atom = trim($doc->saveXML());
foreach ($items as $item) {
$entry = self::entry($doc, $type, $item, $owner, true, 0);
- $root->appendChild($entry);
+ if (isset($entry)) {
+ $root->appendChild($entry);
+ }
}
} else {
$root = self::entry($doc, $type, $item, $owner, true, 0, true);
* @param int $cid Contact ID of the recipient
* @param bool $single If set, the entry is created as an XML document with a single "entry" element
*
- * @return \DOMElement XML entry object
+ * @return null|\DOMElement XML entry object
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
* @todo Find proper type-hints
$mentioned = [];
if (!$item['parent']) {
- return;
+ Logger::notice('Item without parent found.', ['type' => $type, 'item' => $item]);
+ return null;
}
if ($item['deleted']) {
* 'version' => Scheme version
* 'overwrites' => Variables which overwriting custom settings
*/
+
use Friendica\Core\PConfig;
function get_scheme_info($scheme)
{
$theme = \get_app()->getCurrentTheme();
$themepath = 'view/theme/' . $theme . '/';
- $scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'scheme'));
+ if (empty($scheme)) {
+ $scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'scheme'));
+ }
$info = [
'name' => $scheme,