import with createdby and created

More
13 years 3 months ago #30885 by danio_d
Hello,

I need to import content with author info and created data.
Try to import with column created_by with userid, and created with ex. 2010-10-25 but its do not work.

It is possible to import items with userid and create date?

THX
Daniel

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

More
13 years 3 months ago #30886 by johnypas
try to export the data in xml and after that use navicat or phpmyadmin to import it in content table. flexicontent will take care of asset id . make sure that your articles have id s

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

More
13 years 3 months ago #30887 by danio_d
THX Johny, but i try to use import including in flexicontent.
This option work good, but not import createdby and created. And i think i need import itemid also.

debug:
Code:
COLUMNS: field_contact_person, field_miasto, field_wojewodztwo, field_phone, field_email, field_odbior, title, text, field_state, field_cena, created_by, created, hits RECORD no 1: Array ( [type_id] => 3 [language] => pl-PL [catid] => 14 [cid] => Array ( ) [vstate] => 2 [state] => -4 [custom] => Array ( [field_contact_person] => Array ( [0] => John Smith ) [field_miasto] => Array ( [0] => Radlin ) [field_wojewodztwo] => Array ( [0] => 24 ) [field_phone] => Array ( [0] => 666444555 ) [field_email] => Array ( [0] => smith@wp.pl ) [field_odbior] => [field_state] => Array ( [0] => 2 ) [field_cena] => Array ( [0] => 6200 ) [created_by] => Array ( [0] => 398 ) [created] => Array ( [0] => 2010-01-05 00:00 ) [hits] => Array ( [0] => 685 ) ) [title] => Title ites [text] => Lorem ipsum text‚ )

But in sql created_by is 391 (i have this number when i made import) and created date is today. Hits is empty.

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

More
13 years 3 months ago #30893 by ggppdk
comment removed ...

see updated comment bellow: ...


-- 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 review. Thanks!

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

More
13 years 3 months ago #30902 by danio_d
Helo ggppdk,

I hope that You wilt answer :) . Thank You.

I tested your code, but's nothings change. After changes user id is still 391 (like login user), and created is today.

Debug:
Code:
COLUMNS: field_contact_person, field_miasto, field_wojewodztwo, field_phone, field_email, field_odbior, title, text, field_state, field_cena, created_by, created, hits RECORD no 1: Array ( [type_id] => 3 [language] => pl-PL [catid] => 14 [cid] => Array ( ) [vstate] => 2 [state] => -4 [custom] => Array ( [field_contact_person] => Array ( [0] => John Smith ) [field_miasto] => Array ( [0] => Radlin ) [field_wojewodztwo] => Array ( [0] => 24 ) [field_phone] => Array ( [0] => 666555444 ) [field_email] => Array ( [0] => smith@wp.pl ) [field_odbior] => [field_state] => Array ( [0] => 2 ) [field_cena] => Array ( [0] => 6200 ) [created_by] => 393 [created] => 2010-01-05 00:00 [hits] => Array ( [0] => 685 ) ) [title] => Title item [text] => Lorem ipsum text )

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

More
13 years 3 months ago #30903 by ggppdk
Test adding them ...

In file
administrator/components/com_flexicontent/controllers/items.php

about line 840, replace:
Code:
$core_props = array('catid', 'cid', 'language', 'alias');
with
Code:
$core_props = array('catid', 'cid', 'language', 'alias', 'created', 'created_by');

and about line 885, replace:
Code:
if ($fieldname=='title' || $fieldname=='text' || $fieldname=='alias' || $fieldname=='language' || $fieldname=='catid' || $fieldname=='cid') {
with
Code:
if ($fieldname=='title' || $fieldname=='text' || $fieldname=='alias' || $fieldname=='language' || $fieldname=='catid' || $fieldname=='cid' || $fieldname=='created' || $fieldname=='created_by' ) {

Ok, one more change is needed, please test this and report back:

At about line 916 , and before :
Code:
else if ( $fieldname=='catid' ) { if ($maincat_col) $data[$fieldname] = $field_values; }
add
Code:
else if ( $fieldname=='created' || $fieldname=='created_by' ) { $data[$fieldname] = $field_values; }


-- 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 review. Thanks!

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

More
13 years 3 months ago #30905 by danio_d
Great! Now it works great!

THX

But... it is possible to import items from csv with item_id?

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

More
13 years 3 months ago #30909 by ggppdk
OK, for above i will add form options too ...

About item id, you could try/test using same process as above for column with name: id,

Regards


-- 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 review. Thanks!

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

More
13 years 3 months ago #30910 by danio_d
I tried with 'id' but not working.
i also tried with 'item_id' but after import show info

The system has detected that some items are not yet bound to their extended data. Either you have just import them from Joomla!'s com_content or you changed the content section in the global configuration.


and when made 'bind' import new item with standard id and show info:

Warning: array_flip() [function.array-flip]: The argument should be an array in /03v_fabryka/administrator/components/com_flexicontent/models/items.php on line 364


Regards
daniel

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

More
13 years 3 months ago #30912 by ggppdk
Ok, i discourage doing this,

using a specific id would require more change than other item properties, and testing

-- so now you can not use it

what is the reason for wanting specific item id

e.g you have a folder structure that names include the id ? or some other reason that using a specific id would be helpful


-- 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
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
Save