[2.0] Problem beim Speichern von Artikeln

Hier können Probleme und alles andere in Deutscher Sprache gelöst werden.
Post Reply
MarioH
Regular
Posts: 238
Joined: Mon Jul 20, 2009 10:53 pm
Contact:

[2.0] Problem beim Speichern von Artikeln

Post by MarioH »

N'Abend zusammen.

Ich habe gerade mal mein lokales Testblog von Alpha3 auf Alpha4 aktualisiert und ein wenig herumgespielt. Ich habe zusätzlich event_entryproperties und event_freetag installiert. Danach habe ich einen Eintrag geändert und Tags hinzugefügt. Seitdem kann ich keine neuen Einträge mehr speichern und keine alten ändern. Ich bekomme folgende Fehlermeldung:

Update: Ich habe gerade gesehen, neue Einträge werden gespeichert, allerdings kann ich mehrmals auf "Speichern" klicken und der Eintrag wird dann jedes mal erneut angelegt.

Code: Select all

== TESTING ERROR MODE ==

Fatal error: Uncaught exception 'ErrorException' with message 'in_array() expects parameter 2 to be array, null given' in /var/www/s9y20/include/compat.inc.php:126
Stack trace:
#0 [internal function]: errorToExceptionHandler(2, 'in_array() expe...', '/var/www/s9y20/...', 855, Array)
#1 /var/www/s9y20/plugins/serendipity_event_freetag/serendipity_event_freetag.php(855): in_array('2', NULL)
#2 /var/www/s9y20/include/plugin_api.inc.php(1107): serendipity_event_freetag->event_hook('backend_publish', Object(serendipity_property_bag), Array, 1)
#3 /var/www/s9y20/include/functions_entries.inc.php(1440): serendipity_plugin_api::hook_event('backend_publish', Array, 1)
#4 /var/www/s9y20/include/functions_config.inc.php(796): serendipity_updertEntry(Array)
#5 /var/www/s9y20/serendipity_admin.php(52): serendipity_iframe(Array, 'save')
#6 {main}
  thrown in /var/www/s9y20/include/compat.inc.php on line 126
Gruß
Mario
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Problem beim Speichern von Artikeln

Post by Timbalu »

Probiere mal
https://github.com/s9y/additional_plugi ... g.php#L855
durch

Code: Select all

if (in_array($cat['categoryid'], (array)$eventData['categories']) && !in_array($name, (array)$tags)) {
zu ersetzen.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Problem beim Speichern von Artikeln

Post by garvinhicking »

Hi!

Ooops, yeah, I think we need a check like this. Maybe better check if is_array($eventData['categories']) in front of it, rather than using implicit casting? Ian, you could commit that if you like, I think it definitely has advantages over current code.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Problem beim Speichern von Artikeln

Post by Timbalu »

Eigentlich schon, ja. Ich war mir aber nicht sicher auf welches der beiden in_array(...) der param2 Fehler sich bezog, auf $eventData['categories'] oder $tags..?!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
MarioH
Regular
Posts: 238
Joined: Mon Jul 20, 2009 10:53 pm
Contact:

Re: [2.0] Problem beim Speichern von Artikeln

Post by MarioH »

Hallo Ian,

der von dier gepostete Code hat bei mir den Fehler behoben.
Hat ein bisschen gedauert, sorry.

Gruß
Mario
Post Reply