No error when editing entry without category

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

No error when editing entry without category

Post by Barberousse » Mon Feb 12, 2018 4:25 pm

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 769 times
Last edited by Barberousse on Tue Mar 20, 2018 10:12 pm, edited 1 time in total.

User avatar
onli
Regular
Posts: 2160
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: No error in iframe when editing entry

Post by onli » Thu Feb 22, 2018 12:00 pm

Probably if you disable the plugin, saving those entries works again?

Barberousse
Regular
Posts: 26
Joined: Sun Dec 30, 2007 9:07 pm

Re: No error in iframe when editing entry

Post by Barberousse » Tue Mar 20, 2018 8:29 pm

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 9:07 pm

Re: No error when editing entry without category

Post by Barberousse » Thu Mar 22, 2018 2:55 pm

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