I have created a content plugin which adds extra field on Joomla default article editor window and everything working as expected.
But the problem is with existing/old articles created before installing the plugin.
Here what I added on template/html/com_content/article/default.php
$checkPlugin = JPluginHelper::getPlugin('content', 'customdata'); <?php if ($checkPlugin && !empty($attributes->subtitle) : ?> <div><?php echo $attributes->subtitle; ?></div> <?php endif; ?>
It's working perfectly when I add new article, but with existing articles showing below error:
Notice: Undefined property: stdClass::$subtitle in .......\html\com_content\article\default.php on line 41
What I'm doing wrong?