# Content Block - the mistery

**URL:** <https://forum.modmore.com/t/content-block-the-mistery/363>\
**Category:** ContentBlocks\
**Created:** [July 22, 2016, 1:53pm UTC](https://forum.modmore.com/t/content-block-the-mistery/363 "2016-07-22T13:53:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![webmasterunifr](https://forum.modmore.com/user_avatar/forum.modmore.com/webmasterunifr/32/120_2.png) [@webmasterunifr](https://forum.modmore.com/u/webmasterunifr)\
**Post date:** [July 22, 2016, 1:53pm UTC](https://forum.modmore.com/t/content-block-the-mistery/363/1 "2016-07-22T13:53:42Z")

</div>

Hi,

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

 ![](https://forum.modmore.com/uploads/default/original/1X/424c74bc104bae62ad786ae558953dd834ff898e.png)

Do you have some idea? suggestions?

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [July 22, 2016, 3:26pm UTC](https://forum.modmore.com/t/content-block-the-mistery/363/2 "2016-07-22T15:26:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![webmasterunifr](https://forum.modmore.com/user_avatar/forum.modmore.com/webmasterunifr/32/120_2.png) [@webmasterunifr](https://forum.modmore.com/u/webmasterunifr)\
**Post date:** [July 22, 2016, 4:04pm UTC](https://forum.modmore.com/t/content-block-the-mistery/363/3 "2016-07-22T16:04:41Z")

</div>

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 INTO`modx\_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' )`

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [August 3, 2016, 9:19pm UTC](https://forum.modmore.com/t/content-block-the-mistery/363/4 "2016-08-03T21:19:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![webmasterunifr](https://forum.modmore.com/user_avatar/forum.modmore.com/webmasterunifr/32/120_2.png) [@webmasterunifr](https://forum.modmore.com/u/webmasterunifr)\
**Post date:** [August 19, 2016, 7:42am UTC](https://forum.modmore.com/t/content-block-the-mistery/363/5 "2016-08-19T07:42:50Z")

</div>

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](https://www.dropbox.com/s/k9qkxo3m1k5co7g/cbField_v1.0.0.xml?dl=0)

---

<div class="post-metadata">

**Author:** ![webmasterunifr](https://forum.modmore.com/user_avatar/forum.modmore.com/webmasterunifr/32/120_2.png) [@webmasterunifr](https://forum.modmore.com/u/webmasterunifr)\
**Post date:** [August 23, 2016, 12:12pm UTC](https://forum.modmore.com/t/content-block-the-mistery/363/6 "2016-08-23T12:12:10Z")

</div>

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!

 ![](https://forum.modmore.com/uploads/default/original/1X/f3a34be19ac741ffb16b569d49bec90027766d76.png)

---

<div class="post-metadata">

**Author:** ![webmasterunifr](https://forum.modmore.com/user_avatar/forum.modmore.com/webmasterunifr/32/120_2.png) [@webmasterunifr](https://forum.modmore.com/u/webmasterunifr)\
**Post date:** [August 30, 2016, 7:09am UTC](https://forum.modmore.com/t/content-block-the-mistery/363/7 "2016-08-30T07:09:29Z")

</div>

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.
