opencart / opencart

A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution.

Home Page:https://www.opencart.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

modification not working

Samdz19 opened this issue · comments

OpenCart 4.0.2.4

Modification works withe xml file size smaller then 64kb.
but when use a ocmod with file over 64kb the modifcaion not working, can't refresh modication files.
get error ( in log file ) like:

PHP Warning: DOMDocument::loadXML()

PHP Warning: Attempt to read property "textContent"

Call to a member function getElementsByTagName()

The type of xml column in modification table need to be change from TEXT to MEDIUMTEXT, car with MEDIUMTEXT type we can work with file size great than 64kb

@Samdz19

Modification works withe xml file size smaller then 64kb. but when use a ocmod with file over 64kb the modifcaion not working, can't refresh modication files. get error ( in log file ) like:

While the type of the field has been already changed, how poor is that modification when it has a size of 64kB or greater?!

@osworx
Wen change the field type, the ocmod modification works without any issue, but need more works if we compare it with ocmod modification in version 3.x

@Samdz19

Wen change the field type, the ocmod modification works without any issue, but need more works if we compare it with ocmod modification in version 3.x

That's clear, but my comment is related to the size of this modification.
I've created many in the past, some of them realyl complicated and complex - but none of them had more than 2 kB maximum!

So what is so special, that you need more than 64 kB ????
Sounds to me, that you are doing things which could be done (much) better.

@osworx
That's right, the almost of my modification works fine because they are less than 64ko,
But sometimes I need to edit existing modules or themes using using xml file via ocmod or vqmod before, for this it take a big data more than 65ko.

You may consider using proper event handlers, or themes, instead of XML-based modifications.

@Samdz19

  1. as @mhcwebdesign said: then better use events
  2. as former said: when using xml (as modification) AND the file is that size, you doing things complely wrong!
    Instead of adding a whole new file or/and function inside, better create your own controller/model/view and call this then!
    Doing so will result in just a view lines and the size of the xml will be not bigger than 2 max. 3 kB!

But in generall, when working with OpenCart > 3.x better to work with events.

@osworx @mhcwebdesign
Thank you for the advice, that right I am working using event, after opencart remove ocmod on the 4.x
it's better but it need some work when trying to call a controller files.
Thank you again.