1 afwas Jan 17, 2009 18:53
3 afwas Jan 17, 2009 21:19
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
4 sam2kb Jan 17, 2009 21:55
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 :|
5 afwas Jan 17, 2009 22:36
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
6 yabba Jan 18, 2009 07:54
if( empty( $params['Item']->Blog ) )
{
return;
}
;)
¥
7 afwas Jan 18, 2009 08:40
Version 0.3 with fix released. See https://sourceforge.net/project/showfiles.php?group_id=160495&package_id=306566
Thanks sam2kb, thanks ¥åßßå
8 edb Jan 20, 2009 06:05
Please forgive me for asking without testing, but will this remember both main-cat and any sub-cats?
9 yabba Jan 20, 2009 10:22
Yep ;)
¥
10 john Jan 20, 2009 11:08
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