[ php-blog-Bugs-3047591 ] multilingual plugin does not save drafts

"SourceForge.net" <[email protected]> Wed, 18 Aug 2010 13:29:40 +0000
Newsgroups gmane.comp.serendipity.trackers
Message-ID <[email protected]>
Bugs item #3047591, was opened at 2010-08-18 11:38
Message generated for change (Comment added) made by rebum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=542822&aid=3047591&group_id=75065

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Plugins
Group: None
Status: Open
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Martin Matuska (rebum)
Assigned to: Nobody/Anonymous (nobody)
Summary: multilingual plugin does not save drafts

Initial Comment:
If using the serendipity_event_multilingual plugin, drafts are not saved properly - loaded information overwrites the next page.

Patch attached.

----------------------------------------------------------------------

>Comment By: Martin Matuska (rebum)
Date: 2010-08-18 15:29

Message:
I have uploaded a patch against latest CVS.

As you may see, the following is done:
1. We have a backend_entry_updertEntry hook now
- this hook allows us to NOT DO any SQL inserts if we are just switching
the language!
- everything needed is to return $eventData as an array with at least 1
element
2. $props = serendipity_fetchEntry('id', $eventData['id']);
- the default behaviour of serendipity_fetchEntry skips drafts - wa want
to be able to edit drafts, so include the full and draft flags

I have tested this properly this time and have  no more issues.

----------------------------------------------------------------------

Comment By: Garvin Hicking (garvinhicking)
Date: 2010-08-18 15:18

Message:
Hi!

Oh, okay. Thanks for digging into this, I haven't used the plugin for a
longer time. Did you attach the updated patch somewhere? Here I only see
the old one...?

Regards,
Garvin

----------------------------------------------------------------------

Comment By: Martin Matuska (rebum)
Date: 2010-08-18 15:09

Message:
The bugfix was not this easy :-)
I had to examine it much much more and found the real origin of this
problem.
a) if switching languages, an update is always performed. That should
never be the case and there is a hook for this: backend_entry_updertEntry
b) $props = serendipity_fetchEntry('id', $eventData['id']); is wrong, does
not accept drafts

Please revert the previous commit, I have an updated patch.

----------------------------------------------------------------------

Comment By: Garvin Hicking (garvinhicking)
Date: 2010-08-18 12:16

Message:
Hi! Thanks a lot for the patch, I just committed it!

Regards,
Garvin

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=542822&aid=3047591&group_id=75065

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev