2 sam2kb Jan 17, 2009 20:54

Please try in line 121:
if ($this->Settings->get ( 'extra_cats' ) && $Blog->get_setting ( 'save_extra_cats' )) {
If you didn't generate or edit a post this setting doesn't exist (yet). I think that's the issue.
Better would be to instantiate the setting upon installing the plugin. Will see to that.
Thanks for reporting.
--F
The fix doesn't work.
you need something like this...
function AfterItemUpdate($params)
{
if( !is_object($params ['Item']->Blog) )
{
$BlogCache = & get_Cache( 'BlogCache' );
$Blog = & $BlogCache->get_by_ID( $params['Item']->blog_ID );
}
else
{
$Blog = & $params['Item']->Blog;
}
$Blog->set_setting ( 'save_main_cat', $params ['Item']->main_cat_ID );
$Blog->set_setting ( 'save_extra_cats', implode ( ',', $params ['Item']->extra_cat_IDs ) );
$Blog->dbupdate ();
}
It doesn't use "last selected" category anyway, but at least it fixes the error :|
I was thinking something during plugin install but that won't help. Or at least it would need to loop through all available blogs.
I want to see if ¥åßßå can narrow this down to a oneliner. :p
--F
if( empty( $params['Item']->Blog ) )
{
return;
}
;)
¥
Version 0.3 with fix released. See https://sourceforge.net/project/showfiles.php?group_id=160495&package_id=306566
Thanks sam2kb, thanks ¥åßßå
Please forgive me for asking without testing, but will this remember both main-cat and any sub-cats?
Yep ;)
¥
Sweet plugin Afwas... oh, and le "blonde".
Got an error trying to make posts from images (file manager)
Fatal error: Call to a member function set_setting() on a non-object in /../_remember_cat.plugin.php on line 102