Post by unhing3d » Fri Jan 05, 2018 6:50 pm

EDIT: Token removed...

When I try to install import/export tool ( https://www.opencart.com/index.php?rout ... _license=0)
I get the following message:

Code: Select all

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

OK

<b>Warning</b>: Invalid argument supplied for foreach() in <b>/var/www/vhosts/domain.com/httpdocs/admin/controller/marketplace/installer.php</b> on line <b>80</b><b>Warning</b>: Invalid argument supplied for foreach() in <b>/var/www/vhosts/domain.com/httpdocs/admin/controller/marketplace/installer.php</b> on line <b>95</b>{"text":"Installing","next":"https:\/\/www.domain.com\/admin\/index.php?route=marketplace\/install\/install&user_token=&extension_install_id=7"}
Last edited by straightlight on Sun May 17, 2020 11:48 pm, edited 1 time in total.
Reason: Added code tags and removed member_token key and value from extension URL.

Newbie

Posts

Joined
Mon Oct 02, 2017 6:41 pm

Post by IP_CAM » Sat Jan 06, 2018 10:22 am

Export/Import Tool
https://www.opencart.com/index.php?rout ... sion_id=17
Well, the XML File contains an error, as I look at it, since it is not possible,
to add anything AFTER only the first part of a language Variable OcMod Anchor line, like this:
$_['text_backup']
This Language Definition OcMod Anchor line would have to look like this,
for the DEFAULT OC english Language Section at least, in the install.xml file:
$_['text_backup'] = 'Backup / Restore';
to place the OcMod Content correctly, to make it work.
---
So, better, MAKE the additional Language Variable to be inserted by OcMod
BEFORE

Code: Select all

$_['text_backup']
in the install.xml file, like this:

Code: Select all

<search><![CDATA[$_['text_backup']]]></search>
<add position="before"><![CDATA[
$_['text_export_import']             = 'Export / Import';
]]></add> 
and try to install it again, after FIRST clearing out your Modification
Section, to make sure, nothing from the old install attempt still exists.
---
But if you plan to keep this Extensions anyway, I would try to upload the OcMod ADMIN and
SYSTEM Directory with it's Content to the Shop Sub, by use of an FTP Client, and take the
OcMod Code out of the install.xml file, and place it directly into the Source Files, like in the File:
admin/controller/common/column_left.php
BEFORE THIS LINE:

Code: Select all

if ($this->user->hasPermission('access', 'tool/upload')) {
ADD THIS:

Code: Select all

if ($this->user->hasPermission('access', 'extension/export_import')) {
	$maintenance[] = array(
	'name'	   => $this->language->get('text_export_import'),
	'href'     => $this->url->link('extension/export_import', 'user_token=' . $this->session->data['user_token'], true),
	'children' => array()		
	);
} 
----------------------------------------------
and in the File:
admin/language/en-gb/common/column_left.php (english Language!)
BEFORE or AFTER THIS LINE :

Code: Select all

$_['text_backup'] = 'Backup / Restore';
ADD THIS:

Code: Select all

$_['text_export_import']             = 'Export / Import';
---
Just an idea, good Luck! ;)
Ernie

PS: And since the next Version OC will use different Code again, it really does not matter,
if existing OC Source Code is changed, it will be replaced by new Version Files anyway, just to have it said...

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'100 + FREE OC Extensions, on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by JNeuhoff » Sat Jan 06, 2018 7:01 pm

The install.xml file is fine, the OCMOD after attribute means to insert something after the line which has a match of the search expression. The search expression does not have to specify a whole line.

Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by IP_CAM » Sun Jan 07, 2018 5:21 am

Well, this may be correct for OcMods, but my VqModded v.1.5.6.5 turns wild, if
I try such in a language File. It even produces some missing Variable Errors.
And I am working with VqMod 2.6.1...
Ernie

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
4'100 + FREE OC Extensions, on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by JNeuhoff » Sun Jan 07, 2018 7:36 pm

The same is true for VQmod: the after attribute means to insert after the line which has a match of the search expression. the search expression doesn't have to match the whole line.

Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by biga85 » Wed Aug 07, 2019 5:02 am

OpenCart 3.0.3.2 and php5.4.
First time trying to install ocmod extension there is error on line 80 (can't find file "somename.tmp" under /storage/upload/). Second time there is already a tmp file and then error is on line 95 (can't find directory "tmp-anytext" under /storage/upload/). I created this directory and problem solved. When checking if there is a directory it checks that directory is created 5 minutes before installation!
I bet that with php7 there is no such problems as foreach statement in php will see that array is empty and will skip foreach (maybe) but seems not in php5.4 at least.

Newbie

Posts

Joined
Wed Aug 07, 2019 4:54 am

Post by OSWorX » Wed Aug 07, 2019 5:34 am

php 5.4 > throw it away as fast as you can!
And use 7.2.x at least.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 11 guests