User tests: Successful: Unsuccessful:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31339
When saving a items (articles, weblinks, etc), and php error reporting is on max, you'll get an error about Undefined property JTableSomething::$newTags in the php error logs.
This PR fixes the issue.
However, it solves this by initialising the newTags property on the JTable object. I am not sure this is the best way to do this, as this will initialise the property on ALL JTable objects.
Maybe good for someone with a coding-eagle-eye to look into this...
Save an item (article, weblink, etc) and see if the error is no longer there.
Actually if we did this and then added
if (isset($table->newTags))
{
$newTags = $table->newTags;
}
In tags.php at line 774 we could take out the $new->tags from the call and thus not have a change in api. Which would be great.
What I would say is let's add a property that indicates if a table supports tagging (because we don't have a field like asset_id or hits to check for). Then if that is true, set the newTags property.
So
/*
$tagsSupport = true;
// If tagging is supported and the newTags property does not exists, set the default.
if ($this->tags && !property_exists($this, 'newTags'))
{
$this->newTags = array();
}
I think there is more overhead on checking if the tagging is supported than simply setting the $this->newTags = array();
.
Adding an empty array property to the object isn't really that big of a deal.
No it makes more sense because it is more generally useful to have that information all the time (since tags is used for many other things) than it is to always have the information that you only need if you happen to be in a store context and not have any new tags. It's very useful for many many purposes (such as rendering and doing queries) to know if tags is supported especially as we try to make those things more and more generic.
Tracker http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31339