Create Flexicontent item in custom code

More
8 years 4 months ago - 8 years 4 months ago #63120 by ggppdk
Hello

i have re-tested it works with FLEXIcontent
v3.0.14-rc2a
v3.0.15-rc

(in v3.0.14-rc2a you will get 2 harmless notices if you have PHP 7)

Please note that the example code has:
- 6 PHP syntax errors , places with: ...


you are supposed to corrected the syntax errors and add appropriate values
- i have edited the FAQ article and made minor changes 2 comments


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 8 years 4 months ago by ggppdk.
The following user(s) said Thank You: JeBy

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago - 8 years 3 months ago #63476 by JeBy
Hi again. This is still not working for me. I'm getting the error "Failed to create the new item" but no details of how to resolve the error are given (I had to change $item->getError() to $item_model->getError() btw. I did fill in all the blank spaces so it's not that.

I was wondering if the function 'store' does not expect to get an author or at least something to verify that the user CAN add a new item, even if it's from an external script?

Thanks again for all the help!

This is the log:

#Date: 2016-08-02 18:52:15 UTC
#Software: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

#Fields: datetime priority clientip category message
2016-08-02T18:52:15+00:00 DEBUG 78.240.140.75 databasequery SELECT extension_id AS id, element AS "option", params, enabled
FROM ddb_extensions
WHERE `type` = 'component'
2016-08-02T18:52:15+00:00 WARNING 78.240.140.75 deprecated JRequest is deprecated.
2016-08-02T18:52:15+00:00 DEBUG 78.240.140.75 databasequery SELECT lft,rgt FROM ddb_categories WHERE id=1
2016-08-02T18:52:15+00:00 DEBUG 78.240.140.75 databasequery SELECT b.id
FROM ddb_user_usergroup_map AS map
LEFT JOIN ddb_usergroups AS a ON a.id = map.group_id
LEFT JOIN ddb_usergroups AS b ON b.lft <= a.lft AND b.rgt >= a.rgt
WHERE map.user_id = 885
2016-08-02T18:52:15+00:00 DEBUG 78.240.140.75 databasequery SELECT id, rules
FROM `ddb_viewlevels`
2016-08-02T18:52:15+00:00 DEBUG 78.240.140.75 databasequery SELECT folder AS type, element AS name, params
FROM ddb_extensions
WHERE enabled = 1 AND type ='plugin' AND state IN (0,1) AND access IN (1,1,2,3,6)
ORDER BY ordering
2016-08-02T18:52:15+00:00 WARNING 78.240.140.75 deprecated JFactory::getAcl is deprecated. Use JAccess directly.
2016-08-02T18:52:15+00:00 DEBUG 78.240.140.75 databasequery SHOW FULL COLUMNS FROM `ddb_flexicontent_items_tmp`
2016-08-02T18:52:15+00:00 DEBUG 78.240.140.75 databasequery SHOW FULL COLUMNS FROM `ddb_content`
2016-08-02T18:52:15+00:00 DEBUG 78.240.140.75 databasequery SELECT author_basicparams FROM ddb_flexicontent_authors_ext WHERE user_id = 885
2016-08-02T18:52:16+00:00 DEBUG 78.240.140.75 databasequery SHOW FULL COLUMNS FROM `ddb_assets`
2016-08-02T18:52:16+00:00 DEBUG 78.240.140.75 databasequery SELECT *
FROM ddb_assets
WHERE `id` = '1'
2016-08-02T18:52:16+00:00 DEBUG 78.240.140.75 databasequery SELECT a.rules
FROM ddb_assets AS a
WHERE (a.id = 1 OR a.name = 'root.1')
2016-08-02T18:52:16+00:00 INFO 78.240.140.75 - Failed to create the new item
2016-08-02T18:52:16+00:00 DEBUG 78.240.140.75 databasequery SELECT *
FROM `ddb_users`
WHERE `id` = 885
2016-08-02T18:52:16+00:00 DEBUG 78.240.140.75 databasequery SELECT `g`.`id`,`g`.`title`
FROM `ddb_usergroups` AS g
INNER JOIN `ddb_user_usergroup_map` AS m ON m.group_id = g.id
WHERE `m`.`user_id` = 885
2016-08-02T18:52:16+00:00 DEBUG 78.240.140.75 databasequery UPDATE `ddb_session`
SET `data` = 'joomla|s:1972:\"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjoyOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjI6e3M6OToiX19kZWZhdWx0IjtPOjg6InN0ZENsYXNzIjo2OntzO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WQiO3M6MzoiODg1Ijt9czoxNToianNuX29yaWdpbmFsX2lkIjtpOjg4NTtzOjEwOiJjb21fbWFpbHRvIjtPOjg6InN0ZENsYXNzIjoxOntzOjU6ImxpbmtzIjthOjE6e3M6NDA6IjBmYTE1NDk0NDNhZmQ4ZDIyMzhkMTk2M2ZjMGVlZDlkNGI0MjVkODciO086ODoic3RkQ2xhc3MiOjI6e3M6NDoibGluayI7czo2MzoiaHR0cDovL3d3dy50aGVkaXNuZXlkYi5jb20vcHJldmlldy9lbi9uZXdzL2l0ZW0vNjktYW5vdGhlci10ZXN0IjtzOjY6ImV4cGlyeSI7aToxNDcwMTQ4MTA3O319fXM6MTE6ImFwcGxpY2F0aW9uIjtPOjg6InN0ZENsYXNzIjoxOntzOjU6InF1ZXVlIjtOO319czoxNDoiX19mbGV4aWNvbnRlbnQiO086ODoic3RkQ2xhc3MiOjU6e3M6MjA6ImZjX3NjcmVlbl9yZXNvbHV0aW9uIjtzOjg6IjEyODB4NjE5IjtzOjE1OiJmY19zY3JlZW5fd2lkdGgiO3M6NDoiMTI4MCI7czoxNjoiZmNfc2NyZWVuX2hlaWdodCI7czozOiI2MTkiO3M6NzoiZmNkZWJ1ZyI7aTowO3M6MTM6InNhdmVkX2ZjaXRlbXMiO2E6MTp7aTo2OTtpOjE0NzAxNDgxMDY7fX19czo5OiJzZXBhcmF0b3IiO3M6MToiLiI7fQ==\";'
, `time` = '1470163936'
WHERE `session_id` = '8bht25rojtaa0sfl2ltk1e31k0'

Last edit: 8 years 3 months ago by JeBy. Reason: Added log

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #63529 by JeBy
Any idea how to solve this issue using the info in the log? I hope this gets resolved so I can get off your back ;) Thanks again for the great work!

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #63530 by ggppdk
Are you calling code
- from a frontend script ?
- from a backend script ?
- from a Joomla CLI script ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #63546 by JeBy
The code is in a backend script php file that I call through AJAX.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.334 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline