Forums

Article saved to _content table, but doesn't show anywhere

kaiman 28 Sep, 2011
Greetings from Norway!

I just wanted to give my users a simpler form to create Joomla articles, but I just can't get it to work, and at this point I'm close to giving up. 😟
(Ok, maybe not that dramatic yet...)

Using the submitcontent.cfbak without any modifications, other than linking it to my _content table and change the ID's for the categoy and section, everything seems to work. No error messages anywhere, and I can find my article in the db in the _content table using phmypadmin. But it refuses to show up anywhere else! Not even backend in the article manager.

Could this be an article ID problem? I did notice that my CF article's ID seemed to be the same as an older Joomla made article. If my CF article is 183, and I use this syntax to force it to display: index.php?option=com_content&view=article&id=183 ...an older article shows, which has the same ID, but exist in another category/section. (Maybe this is a stupid question, but why does phpMyadmin tell me that I have 107 rows/articles in _content, while the backend article manager displays 153? Is there more than one content table for articles? The mentioned old article with an ID of 183 doesn't exist in _content, but shows as a normal article on my website nevertheless.)

Here's my "On Submit code - after sending email"-code:
<p><span style="color: #0000ff;"><strong>Thank you for submitting your story, we will review it shortly and if approved it will be published!</strong></span></p>
<p><strong>Cheers</strong></p>
<p><span style="text-decoration: underline;"><strong>ChronoEngine.com team!</strong></span></p>
<?php
$_POST['introtext'] = 'Test pƄ introtekst...';
$_POST['catid'] = '83';
$_POST['id'] = '';
$_POST['sectionid'] = '5';
$_POST['state'] = '0';
$_POST['created'] = date("Y-m-d H:i:s");
$_POST['attribs'] = 'show_title=
link_titles=
show_intro=
show_section=
link_section=
show_category=
link_category=
show_vote=
show_author=
show_create_date=
show_modify_date=
show_pdf_icon=
show_print_icon=
show_email_icon=
language=
keyref=
readmore= ';
?>


I'm using Joomla 1.5 and CF v3. I've bought CF, the CF Cookbook and several other articles, I've made a few other forms that should be more complicated. They all work as intended, but I'm frustrated that I just can't get what I thought would be a simple "create Joomla article"-form to work.

I'm probably missing the obvious here, and would be grateful for any hints pointing me in the right direction. :-)
GreyHead 29 Sep, 2011
Hi Kaiman,

I'm not clear what is happening here but the record id in the table must be unique or you will get all kinds of odd side effects. By default it is set to autoincrement a new record gets an id one higher than the last one.

ChronoForms shouldn't affect that. If you load an existing article and preserve the id then the record will be updated, if you create a new article without an id then a new record will be created.

It is possible that some articles have been deleted from the table so the number of artcles isn't the same as the last id.

If you have articles with duplicated IDs you can fix them in PHPMyAdmin if you are careful - using the ids from previously deleted records might help. If you add new IDS you will need to reset the autoincrement value to the new highest record id.

Bob
kaiman 05 Oct, 2011
Thanks a lot for your answer. Much appreciated! :-)

I've given this some thought, but I still don't get why my new CF articles end up with an ID that's already in use. This does not happen with new Joomla made articles.

And why/how would it help changing a CF made article ID to an ID that's been deleted earlier? Will the next CF made article ID be correct, then?

And one more probably REALLY stupid question: I know that f.i. the ID 23 is an ID I can put on my CF article because there's no ID 23 in the table _content, right? (Because it originally was assigned to an article that's been deleted.)
GreyHead 06 Oct, 2011
Hi kaiman,

If it's not happening with Joomla! articles then my best guess is that you have something else in the form that is setting values for 'id'; if it was blank then it would behave the same way as Joomla!.

I know that f.i. the ID 23 is an ID I can put on my CF article because there's no ID 23 in the table _content, right?

Yes, I think that should be safe.

Bob
This topic is locked and no more replies can be posted.