sNews Forum

sNews 1.6 (previous version) => Bug Report => Topic started by: anver on November 22, 2007, 04:13:48 pm

Title: Duplicate Article Error
Post by: anver on November 22, 2007, 04:13:48 pm
Hi All,


I think this is a serious bug in snews 1.6. To reproduce the bug. Log on to admin and add an article.

Step 1.
For example add an article with title  "sample article" without quotes. Type your article content. Add it to the achievements ( I created one already ) category. Now click submit to add the article to the database.

Step 2.
Now add another article with the same title "sample article", the SEF is automatically generated which is also same. Type in the article content.Add it to the same category achievements. Click submit to add the article to the database. Now this error pops up.

Error

The Title already exists.
Be careful: Due to the fact that when something goes wrong most posting options are lost, please check them before posting again.

step 3.

Now change the title "sample article" to "sample article2" and the SEF to sample-article2.
Add the article to the same category called achievements. click submit.
Now it shows "Operation Successfully Completed"


bug1.
You will not be able to see any new articles with the title "sample article2" in the achievements category.

bug2.
you will not be able add another article with the title "sample article2".




Title: Re: Duplicate Article Error
Post by: brauck on November 23, 2007, 10:09:16 am
Yeah, I think you’re quite righ here anver, this looks like a bug.

The warning says: Be careful: Due to the fact that when something goes wrong most posting options are lost, please check them before posting again.

And that is exactly what happens, both the position and the publish field are set to zero, but … we cannot alter them.

The article form doesn’t display the publish checkbox after the exercise you described and we can’t modify the ‘position’field by hand in this state of the process.

On first site I think the function form_articles needs some alterations to preserve the initial values of the position- and publish field.

We have to look in to this.

Well observed anver. Thanks  ;)
Title: Re: Duplicate Article Error
Post by: codetwist on November 23, 2007, 11:34:43 am
Doesn't that patch (http://snewscms.com/forum/index.php?topic=4845.0) help a little in this case as well?
Title: Re: Duplicate Article Error
Post by: brauck on November 23, 2007, 03:58:24 pm
Sjeez, missed that one completely codie, feel stupid  :P
will look into it. thanks   ;)
Title: Re: Duplicate Article Error
Post by: anver on November 24, 2007, 09:25:35 am
Doesn't that patch (http://snewscms.com/forum/index.php?topic=4845.0) help a little in this case as well?

Hi Codetwist,

The patch is not working as well.

thanks,
Title: Re: Duplicate Article Error
Post by: codetwist on November 24, 2007, 12:59:30 pm
Ok. Then there is one more reason to fix both bugs permanently IMHO.
Title: Re: Duplicate Article Error
Post by: philmoz on November 26, 2007, 06:16:10 pm
Ok, just retested that patch on an an modified snews.

The first part operates enough to 'unhide' the article in the 'unpublished' state. The article will need to be reedited to place it in the desired category and to make published.
Title: Re: Duplicate Article Error
Post by: anver on November 27, 2007, 02:48:34 pm
Ok, just retested that patch on an an modified unmodified snews.

The first part operates enough to 'unhide' the article in the 'unpublished' state. The article will need to be reedited to place it in the desired category and to make published.

The articles are appearing in the unpublished state only after logging out of the admin and re-logging. I dont think this is a proper solution. Sorry for asking this what is a modified snews Philmoz ?
Title: Re: Duplicate Article Error
Post by: Keyrocks on November 27, 2007, 03:22:35 pm
I think Philmoz meant to say he tested it on an un-modified sNews install... one that has no other modifications.  :)
Title: Re: Duplicate Article Error
Post by: philmoz on November 28, 2007, 07:26:56 am
um, yep, unmodified.
... and no, I haven't had to log out either, just refresh the admin panel, and the article will now be present.
Title: Re: Duplicate Article Error
Post by: anver on November 28, 2007, 05:28:43 pm
If i am correct i see one more bug, if not please excuse me.

Bug reproduction How to:

Note: This is after applying the patch posted by codetwist. See the previous post from codetwist.

1. Log on to admin
2. add new article.
3. add another article with the same title and Sef title
4. The error pops up.
"Error
The Title already exists.
Be careful: Due to the fact that when something goes wrong most posting options are lost, please check them before posting again."

This is ok. An error must occur at this point and is displayed. But see carefully below you will miss something. The publish article option and the display date option. Why is this happening when the user do have the option to rename the article title and sef title ?  I consider this as a bug but i dont know if it exists for some other reason.
Secondly all other options are still there, so when I rename the article title and the Sef title and add the article to a category, why should that new RENAMED article go to an unpublished state ?  Why don't the user have the option to make the article published right away ?.

Philmoz was correct that refreshing the admin is enough to view the unpublished article but please do consider the above problems serious and find some permanent solution asap.

Thanks.
 
Title: Re: Duplicate Article Error
Post by: philmoz on December 07, 2007, 09:43:56 pm
@anver, you are correct.
What is not happening, on error, is the return of submitted field data to the page (except content).

But then the 'patch' is not a full fix, only a means to allow the content to be 'found' (because it is saved to db) and therefore allow corrections to be made to other posting options.

As I stated in the patch post:
Quote
Multiple re-edits will rectify, and prevent the need to  delve into the db with phpmyadmin.
(not satisfactory, but the article will not 'disappear into the ether')
Title: Re: Duplicate Article Error
Post by: Vivvo on December 21, 2007, 06:34:04 am
Mm, I've also had this a couple of times. But I thought it was because I was posting the same article again on my site that was alreay there with the same title. I thought it was a feature to stop you creating a duplicate article.
Title: Re: Duplicate Article Error
Post by: Joost on December 21, 2007, 07:34:47 am
Both is true. There is a feature that prevents posting an article with a title that's already in the database. However, there is a bug that shows almost the same symptoms.
Title: Re: Duplicate Article Error
Post by: Rui Mendes on December 27, 2007, 11:03:48 am
I'm not in my dev machine, but can you try this Patch (http://snewscms.com/forum/index.php?topic=6551.0). I think this one will solve your/our problem