Page 1 of 1

Can't install modification, getting "Modification requires a unique ID code!" error.

Posted: Thu Jun 22, 2017 1:24 am
by ilmix2017
I'm going through opencart tutorial ("Opencart tips and tricks") and when I try to upload my modification using Extensions installer I get the following error: "Modification requires a unique ID code!". The modification has the <code> tag. I'm using opencart 2.3.0.2 on xampp . What could be causing this?

Re: Can't install modification, getting "Modification requires a unique ID code!" error.

Posted: Thu Jun 22, 2017 2:00 am
by Johnathan
The ocMod file needs a <code> declaration at the top of the file (within the <modification> tag). The ocMod example on Github doesn't have this, which is dumb because it's a requirement. For example:

<code>my_code_name</code>

Re: Can't install modification, getting "Modification requires a unique ID code!" error.

Posted: Thu Aug 24, 2017 7:42 pm
by soundzgood-nz
You will also get this error message if you don't close any of the other tags, eg

Code: Select all

<file path="catalog/view/theme/*/template/account/order_info.tpl">
    <operation>
      <search>
        <![CDATA[<a href="<?php echo $product['return']; ?>" data-toggle="tooltip" title="<?php echo $button_return; ?>" class="btn btn-danger"><i class="fa fa-reply"></i></a></td>]]>
      </search>
      <add position="replace">
        <![CDATA[</td>]]>
      </add>
    </operation>
  <file path="catalog/view/theme/*/template/extension/module/account.tpl">
    <operation>
    
Missing </file> tag before new <file> declaration.
Simon

Re: Can't install modification, getting "Modification requires a unique ID code!" error.

Posted: Sun Nov 19, 2017 8:38 pm
by GilesM
I would also point out that I got this message as well due to having an illegal character in the <link></link> section of the header.

Removed the link and everything worked fine!