Insert article directly in database? Topic is solved

For Joomla! 4.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
henri_007
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sat Jun 09, 2012 10:50 am

Insert article directly in database?

Post by henri_007 » Tue Jul 05, 2022 6:14 pm

I'm programming small app that connect to joomla database and I want to put article directly in database. In which table(s) I should put article? I put in _content, but I don't see it in backend? I guess that I need to insert data in another table, but I don't know in which?

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 7823
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Insert article directly in database?

Post by AMurray » Tue Jul 05, 2022 9:28 pm

There's more than one table that makes up the article in Joomla.

https://docs.joomla.org/Tables/content explains it.

To me it's a foreign language, to a developer it makes sense.
Regards - A Murray

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 970
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Insert article directly in database?

Post by ceford » Wed Jul 06, 2022 7:43 am

I think you need to read through the code of getListQuery function in administrator/components/com_content/src/Model/ArticlesModel.php especially the joins to tables other than #__content. I think you need an entry in #__workflow_associations

You could also turn on debugging and look down the list of queries to find the one used to fetch the articles list. That should give you a clue to what you have not set.

henri_007
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sat Jun 09, 2012 10:50 am

Re: Insert article directly in database?

Post by henri_007 » Wed Jul 06, 2022 9:24 am

There's more than one table that makes up the article in Joomla.

https://docs.joomla.org/Tables/content explains it.

To me it's a foreign language, to a developer it makes sense.
Thank you! According that documentation, only foreign key is asset_id, and according this url https://www.itoctopus.com/creating-new- ... sets-table it is not necessary


ceford wrote:
Wed Jul 06, 2022 7:43 am
I think you need to read through the code of getListQuery function in administrator/components/com_content/src/Model/ArticlesModel.php especially the joins to tables other than #__content. I think you need an entry in #__workflow_associations

You could also turn on debugging and look down the list of queries to find the one used to fetch the articles list. That should give you a clue to what you have not set.
Thanks, I will try this....

gws
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4749
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Insert article directly in database?

Post by gws » Wed Jul 06, 2022 9:46 am


Thank you! According that documentation, only foreign key is asset_id, and according this url https://www.itoctopus.com/creating-new- ... sets-table it is not necessary
I don't see that this link has any relevance to your original question?
Have a look at https://www.[youtube].com/watch?v=YCs6YD_H14c
Last edited by gws on Wed Jul 06, 2022 9:56 am, edited 1 time in total.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 23791
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Insert article directly in database?

Post by pe7er » Wed Jul 06, 2022 9:48 am

ceford wrote:
Wed Jul 06, 2022 7:43 am
I think you need an entry in #__workflow_associations
Create a new article in the back-end. You will see that new article in the Articles overview.
And #__workflow_associations will have a new record for that article.

To see the imported articles, you'll need to create records for those articles in #__workflow_associations as well.
Kind Regards,
Peter Martin, Global Moderator
https://db8.nl - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 970
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Insert article directly in database?

Post by ceford » Wed Jul 06, 2022 12:12 pm

gws wrote:
Wed Jul 06, 2022 9:46 am
Have a look at https://www.[[youtube]].com/watch?v=YCs6YD_H14c
I watched this video and found it fascinating! I used to teach something on databases and normalisation so the content was familiar to me, except for the WP comparison. Those who need to persuade a boss to choose Joomla rather than WP should take a look.

henri_007
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sat Jun 09, 2012 10:50 am

Re: Insert article directly in database?

Post by henri_007 » Wed Jul 06, 2022 3:52 pm

Thank you guys! It's need to add record to #__workflow_associations! :)


Post Reply

Return to “Joomla! 4.x Coding”