Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#1890 closed bug (fixed)

new topic: error notice when topic text field was empty

Reported by: mahouni Owned by: mahouni
Priority: trivial Milestone: 1.4
Component: BW Forum Keywords: 1.5 1.6


writing a new topic entering a title but no message text will give an error.

something like "IdTitle? not set".

solution: test if $varsIdTitle? is set. fix ready for one of the next releases.

Change History (13)

comment:1 Changed 6 years ago by shevek

  • Keywords 1.5 1.6 added

I tested this today and I got a flash message. What's wrong with that?

But if you also don't enter a text the error flash for that ends up next to visibility.

I have a fix ready to move both flash messages to the top.

Last edited 6 years ago by shevek (previous) (diff)

comment:2 Changed 6 years ago by mahouni

  • Milestone changed from unassigned to 1.4
  • Status changed from new to local_testing

comment:3 Changed 6 years ago by shevek

If you leave both text fields empty, two flash messages are shown on top of the topic.

Unfortunately on reply and edit the content of the text area isn't checked at all so it is possible to delete the whole content without getting an error message. Might be to enable mod deletes but is a bit ugly.

The original problem still persists and stems from this line:

echo isset($varstopic_title?) ? $words->fTrad($varsIdTitle?) : ;

I'm not sure if checking if 'IdTitle?' is set will help here. I guess it's better to change to topic_title instead. But need to check that.

comment:4 Changed 6 years ago by shevek

The fix for the notice is simple.

echo isset($vars['topic_title']) ? $vars['topic_title']: $words->fTrad($vars['IdTitle']);

Unfortunately I'm pretty sure it breaks something as the current line mingles edit mode and create.

This works fine till you decide to switch languages and a translated version of the topic title exists. Should it switch to the old title in the translation or rather use the new content of the topic_title field? Or the other way round if no translation exists yet should it clear the edit field?

comment:5 Changed 6 years ago by mahouni

maybe I missed something with the translation issues. What I tried was this here:

please test locally if you still can edit and create topics in different languages etc.

comment:6 Changed 6 years ago by shevek

No problems creating and editing different topics. It just overwrites the edit field with the current translation for the language you switched to which is okay I guess.

comment:7 Changed 6 years ago by crumbking

Creating a new group only thread without title I get a notice in the form:

Notice: Undefined index: IdTitle? in /var/rox/deployment/ on line 122

The message is correct: Please enter a title for this post.

I know the notice is not shown on www but it's still not nice ;-)

comment:8 Changed 6 years ago by shevek

Maybe that's because the patch isn't on alpha yet?

comment:9 Changed 6 years ago by crumbking

Mmm... could be damn ;-)

comment:10 Changed 6 years ago by crumbking

  • Status changed from local_testing to to_alpha

works locally

comment:11 Changed 6 years ago by jsfan

  • Status changed from to_alpha to testing

comment:12 Changed 6 years ago by shevek

  • Resolution set to fixed
  • Status changed from testing to closed

Tested and regarded as fixed.

comment:13 Changed 6 years ago by planetcruiser

tested ok, no more notice when trying to create a new forum post without title

Note: See TracTickets for help on using tickets.