No error when editing entry without category

Found a bug? Tell us!!
Post Reply
Barberousse
Regular
Posts: 26
Joined: Sun Dec 30, 2007 8:07 pm

No error when editing entry without category

Post by Barberousse »

Hello,

On S9Y 2.1.1, I noticed that there is no error shown when the entry has no category or no title, even if the serendipity_event_entrycheck plugin is set up to forbid such entries. The next problem is that the entry is not saved, but I have a message saying that "Serendipity is saving the entry" (or something like that, but in french, the attached image). Any idea ?

No error in apache2 log, PHP 5.6.33-1+ubuntu16.04.1+deb.sury.org+1, Firefox 58.0.1 or Chromium 64.0.3282.140 Ubuntu
Attachments
bps9y.png
bps9y.png (49.41 KiB) Viewed 3958 times
Last edited by Barberousse on Tue Mar 20, 2018 9:12 pm, edited 1 time in total.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: No error in iframe when editing entry

Post by onli »

Probably if you disable the plugin, saving those entries works again?
Barberousse
Regular
Posts: 26
Joined: Sun Dec 30, 2007 8:07 pm

Re: No error in iframe when editing entry

Post by Barberousse »

Weird, it seems that serendipity.checkSave() is never called in templates/2k11/admin/serendipity_editor.js.tpl, except from serendipity_event_autosave

And serendipity_event_autosave calls checkSave(), and not serendipity.checkSave()...

If I add the call to serendipity.checkSave() on

Code: Select all

<input type="submit" value="{$CONST.SAVE}">
which becomes

Code: Select all

<input type="submit" onclick="return serendipity.checkSave();" value="{$CONST.SAVE}">
in templates/2k11/admin/entries.tpl, I have this error:

Code: Select all

TypeError: el is null
on

Code: Select all

el = document.getElementById('categoryselector');
in serendipity.checkSave(), while calling code generated by event_hook(backend_entry_checkSave, ...) in plugins/serendipity_event_entrycheck/serendipity_event_entrycheck.php
Barberousse
Regular
Posts: 26
Joined: Sun Dec 30, 2007 8:07 pm

Re: No error when editing entry without category

Post by Barberousse »

I created 3 PR to correct the problem:

https://github.com/s9y/Serendipity/pull/544
https://github.com/s9y/Serendipity/pull/545
https://github.com/s9y/additional_plugins/pull/72

Edit (23/03/2018): the PR are merged now on master branch.

Maybe this should be ported to version 2.1 as well
Post Reply