Content Block - the mistery

Hi,

somebody have already experimented the impossibility to import fileds (selecting the replace option)?

Do you have some idea? suggestions?

Hi Samuel, that’s odd. Any errors in the MODX error log?

1 Like

The only error found was this one…

[2016-07-22 15:47:06] (ERROR @ /nte/assets/components/contentblocks/connector.php) Error 23000 executing statement: INSERT INTOmodx_contentblocks_field(id,parent,parent_properties,input,name,description,sortorder,category,icon,icon_type,template,properties,availability,layouts,times_per_layout,times_per_page,settings) VALUES (35, 28, '{\"key\":\"title\",\"width\":\"100\"}', 'heading', 'Title', '', 1, 0, '', 'core', '<[[+level]]>[[+value]]</[[+level]]>', '{\"default_level\":\"h2\",\"available_levels\":\"h2=heading_2,h3=heading_3\",\"use_tinyrte\":\"1\"}', '', '', 0, 0, '[]') Array ( [0] => 23000 [1] => 1062 [2] => Duplicate entry '35' for key 'PRIMARY' )

Hm that sounds like somehow it’s failing to remove the fields first (as it should because you chose replace mode). Any errors about that further up in the log perhaps?

1 Like

Hi Mark,

The problem seems not to be with Delete.

After some test it appears to be only if a field has a parent.
I tried to invert the place of parent in XML (in our case to put ID28 before a child of 28) and the problem still appear.

When I choose the REPLACE option, the field are deleted.
The import start but stop when an entry with a child is found in XML.

If I reload the ContentBlocks Page, I see the import of 3 fields (3 first fields without parents).

If I manually empty all fields and choose:

  • REPLACE -> KO
  • OVERRIDE -> OK

Perhaps the process of import is not the same for childs in both options?
If I start with no fields, the REPLACE and the OVERRIDE must have the same comportment? isn’t it?

Thank you for your help

Here an example of export: https://www.dropbox.com/s/k9qkxo3m1k5co7g/cbField_v1.0.0.xml?dl=0

another strange effect of the this problem with the import.

After a successful import with overwrite: every properties of the field’s type repeater is doubled!

Strange comportement: if I import the same file on a very fresh install, the first import is OK with option “Override” but next import doesn’t work anymore.