Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: New Extra Contents issue when no title added  (Read 5456 times)

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
New Extra Contents issue when no title added
« on: May 31, 2007, 12:23:15 PM »

ok, I think this is a bug.  I'm using Mika's 1.6.01DE package from his website.

here's the steps to reproduce the bug:

- login to admin panel
- click Extra contents: Add new
- insert Extra Content text in Text field (leave Title field blank)
- click submit

then this appears:


The 'Operation completed successfully!' notification appears, and directly below it appears the New Article dialogue box? (see screenshot above).

The Extra Contents is not visible on the site nor is it added to the database (which would indicate the operation is far from successful! ;))

Everything works as expected if a title is added to the Extra BEFORE submitting it.

Now I know you can simply add a title and uncheck the Display Title checkbox in Customize, however there should be some form of error checking that notifies the user they have not added a title.  The 'Operation completed successfully!' notification should not be displayed.  And I can't workout why the New Article dialogue box appears?

EDIT: ok after further testing, it appears this issue is not just limited to Extra Contents.  The exact same thing happens if you do not enter a title when adding a new Page.
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
New Extra Contents issue when no title added
« Reply #1 on: May 31, 2007, 03:55:39 PM »

I just replicated your steps and when i submit an "Extra" without a title I am re-directed to the New Article Panel with an ERROR title and message displayed above it saying... "The title cannot be empty. Be careful: Due to the fact that when something goes wrong most posting options are lost, please check them before posting".

If I enter a title when making a new "Extra" in any given category page, it submits successfully and displays where it should be.

If I want an "Extra" published and displayed in any category, I must enter a title in the title field so that an SEF link is created on "Submit" in the articles table. This is required so that sNews can find the "Extra" to display it. If I don't want the title displayed with the "Extra" contents, then I open the "Customize" panel... choose the category page I want it displayed on... and un-check the "Display Title" option under it.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
New Extra Contents issue when no title added
« Reply #2 on: June 01, 2007, 01:45:35 AM »

Quote from: keyrocks
I just replicated your steps and when i submit an "Extra" without a title I am re-directed to the New Article Panel with an ERROR title and message displayed above it saying... "The title cannot be empty...
Are you using Mika's DE version without any MODs?  I know there's only a couple of bugfixes applied to MIka's latest DE, but it may make a difference.

I have tried this step several times and the same thing occurs, I receive the 'Operation completed successfully!' notification (but nothing is published nor posted to the database) and the New Article panel appears.  It would be a start if I received the error message but that is not the case.  I shall try another reinstall and see what happens.

What is strange to me keys, you say you get the error message and then are redirected to the New Article panel.  Why is sNews redirecting to the New Article panel?!  Should it not redirect to the New Extra panel??
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
New Extra Contents issue when no title added
« Reply #3 on: June 01, 2007, 03:29:55 PM »

Quote from: piXelatedEmpire
What is strange to me keys, you say you get the error message and then are redirected to the New Article panel.  Why is sNews redirecting to the New Article panel?!  Should it not redirect to the New Extra panel??
Good question. I haven't looked into it but I agree... it should re-direct to the "Extra" panel so you could add the title in to correct the situation. This in itself could certainly be considered a "minor bug".
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
New Extra Contents issue when no title added
« Reply #4 on: June 01, 2007, 09:11:35 PM »

see partial fix in patch/fixes forum.
http://snewscms.com/forum/index.php?topic=4845
« Last Edit: August 21, 2007, 09:17:23 PM by Phil Martin »
Logged
Of all the things I have lost, it is my mind that I miss the most.

mosh

  • Hero Member
  • *****
  • Karma: 77
  • Posts: 510
  • Awesome day :)
    • cms-zen
Re: New Extra Contents issue when no title added
« Reply #5 on: October 17, 2007, 01:27:29 PM »

hey :)
a small solution i use,
is to prevent any action befor the title is set, with javascript.

it go like this:

in snews.php
ADD TO: LANGUAGE VARIABLES
Code: [Select]
$l['title_missed'] = 'Please Enter Title and SEFtitle';

FIND REPLACE in function form_articles :
this line
Code: [Select]
echo html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', $frm_action, '');

with this
Code: [Select]
echo html_input('form', '', 'post', '', '', '', 'onsubmit="return validateForm(this)"', '', '', '', '', '', 'post', $frm_action, '');

ADD TO JS PART:
Code: [Select]
//////////////////////////////////////////////
//make sure the form has a title.
       function validateForm(formobj) {
if (formobj.title.value == '') {
alert('<?php echo l('title_missed'); ?>');
formobj.title.focus();
return false;
}
         return true;
}

the language variable can be change to suit your needs.


hope it help :)
awesome day
« Last Edit: October 17, 2007, 01:31:16 PM by mosh »
Logged

Sasha

  • Hero Member
  • *****
  • Karma: 28
  • Posts: 938
    • cssanarchy.com
Re: New Extra Contents issue when no title added
« Reply #6 on: January 14, 2009, 07:42:20 AM »

what happend when you use code brak in extra function ..that is not working on my script snews 1.6 hm  ???
Logged
Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work. | If you love your job, you haven't worked a day in your life. snews with ♥