Post by WizzSt » Fri Apr 24, 2020 7:24 pm

Hi.
I recently installed OpenCart ver. 3.0.3.2.
I installed a local copy on localhost (windows 7 with XAMPP) and one on a web hosting provider. Both installation were fine.
In both versions I made same very small OCMOD modifications to .twig files.

On the live version, when I go to admin area, language editor, and click on "add new", the page opens fine, and I can see the fields :store, language, route etc.
But on my local copy, i can see the fields :store and language, but the select box with the route is empty.
So, i installed a fresh copy of opencart in another location with a new database and again I can not see the route in language editor.
The theme editor, banners and all other pages under design are working fine.

So, just to check that it is not a localhost issue, i installed ubuntu on VMWare, installed all the prerequisites, and then OpenCart. And the language editor works fine.
I have recently started working with opencart, and some of the finer points are still eluding me :) , but even if i could work on the virtual machine, it is not that practical, and i would really like to know why this is happening.

Any help from fellow developers would be very appreciated!

Newbie

Posts

Joined
Wed Apr 22, 2020 8:44 pm

Post by straightlight » Sun Apr 26, 2020 7:48 pm

So, just to check that it is not a localhost issue, i installed ubuntu on VMWare, installed all the prerequisites, and then OpenCart. And the language editor works fine.
While the master branch might have small bug-fixes about the language editor, I would suggest to try the development package in your test environment (not for production) and see if the same issue occurs. However, based on this scenario, since you've installed Opencart on VMWare and the language editor seem to be working fine, then it is not an Opencart issue either at this point unless the master branch version provides alternative results as opposed to OC v3.0.3.2.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by WizzSt » Mon Apr 27, 2020 5:15 pm

Hi.
Thank you for the reply.

Yes, i do not think this is an OpenCart issue :).

I was just wondering if anyone had this kind of problem, and maybe a solution.

I will try your suggestion.

Thank you again!

Newbie

Posts

Joined
Wed Apr 22, 2020 8:44 pm

Post by paulfeakins » Mon Apr 27, 2020 6:48 pm

It sounds like you've got a complicated setup and a complicated issue so it's quite hard to help without a bit clearer info about everything.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by WizzSt » Mon Apr 27, 2020 7:20 pm

paulfeakins wrote:
Mon Apr 27, 2020 6:48 pm
It sounds like you've got a complicated setup and a complicated issue so it's quite hard to help without a bit clearer info about everything.
Hi.
My setup on the dev enviroment (where the problem occurs) is like this(they are all fresh installations):

OS: Windows 7 Ultimate Edition Service Pack 1
Apache version 2.4.43
PHP version 7.4.5
Document root: C:/Apache24/htdocs/opencart
All php extensions for opencart installation were installed.

MYSQL: MySQL Community Server 8.0.19

After setting my custom local domain in windows hosts, and changing the document root apache config to point to the "opencart" folder, I put the opencart folders in C:/Apache24/htdocs/opencart, and started the installation by going to mylocaldomain.
While installing, I had a problem with strict mode in the database, so i removed strict mode, deleted the opencart database, and started the installation of opencart again. The installation completed without problems, and I deleted the install folder.

Without changing anything, i logged to opencart admin and moved the storage outside the site root. The theme editor and all other links worked perfectly, only the language editor did not show any routes.

I hope this clarifies my setup, if you need further info, please let me know!

Thanks!

Newbie

Posts

Joined
Wed Apr 22, 2020 8:44 pm

Post by daade_selei » Sun Jun 07, 2020 9:49 pm

I am struggling with the same problem.

I have just;
installed XAMPP on two machines, (following default install options),
installed OpenCart following the instructions on the website (after watching many youtube videos to ensure I am doing it correctly),
attempted to edit the script at the bottom of the page "powered by..."

Both machines have the same problem:
STORE - DEFAULT (no other options from the dropdown)
LANGUAGE - ENGLISH (no other options from the dropdown)
ROUTE - BLANK!!! (no options from the dropdown)
KEY - BLANK!!! (no optinons from the dropdown)

I'm using XAMPP because that is what OpenCart suggests for local development, but it seems to me that XAMPP may be the problem with Language Editor (and everthing which can be edited from therein).

Is there a better virtual server I could be using which allows Language Editor (and the subtleties of OpenCart) to actually work?
(is it just me??? Can other people get Language Editor working under XAMPP??? Where am I going wrong???)

All advice welcome.

Best Regards,
Dave

WIN10-64-1909: build 18363.836
XAMPP v3.2.4
OPENCART 3.0.3.3

Newbie

Posts

Joined
Sun Jun 07, 2020 9:29 pm

Post by straightlight » Sun Jun 07, 2020 9:53 pm

daade_selei wrote:
Sun Jun 07, 2020 9:49 pm
I am struggling with the same problem.

I have just;
installed XAMPP on two machines, (following default install options),
installed OpenCart following the instructions on the website (after watching many youtube videos to ensure I am doing it correctly),
attempted to edit the script at the bottom of the page "powered by..."

Both machines have the same problem:
STORE - DEFAULT (no other options from the dropdown)
LANGUAGE - ENGLISH (no other options from the dropdown)
ROUTE - BLANK!!! (no options from the dropdown)
KEY - BLANK!!! (no optinons from the dropdown)

I'm using XAMPP because that is what OpenCart suggests for local development, but it seems to me that XAMPP may be the problem with Language Editor (and everthing which can be edited from therein).

Is there a better virtual server I could be using which allows Language Editor (and the subtleties of OpenCart) to actually work?
(is it just me??? Can other people get Language Editor working under XAMPP??? Where am I going wrong???)

All advice welcome.

Best Regards,
Dave

WIN10-64-1909: build 18363.836
XAMPP v3.2.4
OPENCART 3.0.3.3
Can you confirm if it's still the case with the pre-release version: viewtopic.php?f=2&t=218204 or with the master branch version?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by daade_selei » Mon Jun 08, 2020 8:40 am

Hi Straightlight, thanks for the quick response.

If you are asking which version I am using, it is the "download now" (green button, right hand side) from https://www.opencart.com/index.php?route=cms/download - which I believe is the master stem version?

If that is not what you are asking, I'm afraid I don't understand your question. (apologies in advance)

Newbie

Posts

Joined
Sun Jun 07, 2020 9:29 pm

Post by sw!tch » Tue Jun 09, 2020 4:10 pm

Rollback to PHP 7.3 or try the pre-release. I think its related to twig and PHP 7.4

You can find releases here https://github.com/opencart/opencart/releases

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by letxobnav » Tue Jun 09, 2020 5:13 pm

You could open web developer tools (network tab) while going into the editor.
Look at ajax request:

Code: Select all

index.php?route=design/translation/path&user_token=YOURTOKEN&language_id=YOURLANGUAGE
and see what the response of that ajax call is.
That call should return the paths, json encoded, filling the route dropdown via function:

Code: Select all

	public function path() {
		$this->load->language('design/translation');

		$json = array();

		if (isset($this->request->get['language_id'])) {
			$language_id = $this->request->get['language_id'];
		} else {
			$language_id = 0;
		}

		$this->load->model('localisation/language');

		$language_info = $this->model_localisation_language->getLanguage($language_id);

		if (!empty($language_info)) {
			$path = glob(DIR_CATALOG . 'language/'.$language_info['code'].'/*');

			while (count($path) != 0) {
				$next = array_shift($path);

				foreach ((array)glob($next) as $file) {
					if (is_dir($file)) {
						$path[] = $file . '/*';
					}

					if (substr($file, -4) == '.php') {
						$json[] = substr(substr($file, strlen(DIR_CATALOG . 'language/'.$language_info['code'].'/')), 0, -4);
					}
				}
			}
		}

		$this->response->addHeader('Content-Type: application/json');
		$this->response->setOutput(json_encode($json));
	}

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by sw!tch » Tue Jun 09, 2020 5:57 pm

letxobnav wrote:
Tue Jun 09, 2020 5:13 pm
You could open web developer tools (network tab) while going into the editor.
Look at ajax request:
Yeah, this is a strange bug..

I think its twig along with PHP 7.4 and the way it's parsing awkward comments.

I quickly tested locally on PHP 7.4 and get a console

Code: Select all

SyntaxError: Parser error
Oddly if you remove the comment from admin/view/template/design/translation_form.twig line 97

Code: Select all

<script type="text/javascript"><!--
to

Code: Select all

<script type="text/javascript">
XHR requests then appear to fire and it resolves. Don't have time to test fully, but some reports over on twig about spacing issues and PHP 7.4 .

Looks like the OC team is moving twig to composer in 3.1 series, so will be easier to update and test external libraries like this.

If anyone else wants to confirm the same feel free.

@straightlight might want to check if this was patched in the upcoming pre-release. A lot of users with PHP 7.4 installs lately.

Edit -- Also confirmed in Pre-release Version 3.0.3.4, maybe put a max version of PHP 7.3 there are a lot of PHP 7.4 issues that need to be resolved.

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by straightlight » Tue Jun 09, 2020 7:34 pm

I spoked to Daniel last week about the PHP version compatibility as a minimum requirement. 7.1 is a bit outdated and should be focused between PHP v7.3.1 to PHP v7.3.9. As the pre-release version gets patched periodically, it also contains minimum patching for PHP v7.4. I am going slowly on this so not to impact all the users as for their extensions use on a too fast basis. Changes will keep growing, yes, but to the point to remove the

Code: Select all

<!--
for each JS calls, that might be a difficult road to take since users are also suggested to revert back to previous PHP versions where these issues were not reported before either. Should we remain on the higher version is not a requirement at this time but will have to be dealt in the future once the pre-release version will be released as a final release. Right now, the best course of action would be to remain within the range so to ensure the flexibility of the platform due to the past and long-term bugs that were discovered and finally to the stage to get resolved overall until the next changes comes in.

So to add, PHP version compatibility may also be due to server-specific settings as opposed to other users where the same PHP version could also work as intended with the platform.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by djewell » Mon Jul 20, 2020 10:55 am

I think I have hit a similar issue but in a different place but maybe related if any of that makes sense. I did a translation on my shipping methods and now when a customer tries to check out they get a no shipping options available. Am I to assume this is part of the language editor problem or is this something else. I deleted the translations and now it "appears" to be working ok. I did patch the translation module with the suggested removal of code and now I can access the translations but if they are causing problems not sure what to do.

Newbie

Posts

Joined
Mon Mar 23, 2020 10:50 pm

Post by sw!tch » Mon Jul 20, 2020 11:36 am

Well, the comment removal above I believe was actually a twig issue with PHP 7.4 to where it would produce spacing issues.

Looking at the latest Opencart release 3.0.3.5. it looks like twig was updated, I haven't tested that version, but probably resolves the above issue.

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by djewell » Wed Jul 22, 2020 9:19 am

Switch were you referring to my issue with the language issue and the shipping module or the issue with language translation in general?

Newbie

Posts

Joined
Mon Mar 23, 2020 10:50 pm

Post by letxobnav » Wed Jul 22, 2020 9:32 am

Since OC hardly functions without javascript enabled I don't understand why you would continue to use this comment stuff in the first place.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by sw!tch » Wed Jul 22, 2020 10:14 am

djewell wrote:
Wed Jul 22, 2020 9:19 am
Switch were you referring to my issue with the language issue and the shipping module or the issue with language translation in general?
This doesn't sound related to your problem did you have a problem using the language editor? What version of PHP and OC are you running?

To clarify - The comment problem was related to twig on PHP 7.4 , the bug is actually documented in the twig repo.

Basically what happens is when twig parses the template file, the spacing becomes screwed up causing those bizarre Javascript comments to run into one line, which in return breaks the JS code.

I assume this has been fixed in the last two OC releases 3.0.3.5 , 3.0.3.6 , since twig was updated. If you are currently on PHP 7.4 you may want to rollback to PHP 7.3.9 until a somewhat stable OC release is put out or wait a bit before updating to 3.0.3.5 , 3.0.3.6 as I doubt those versions have even been extensively tested in PHP 7.4.

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Who is online

Users browsing this forum: No registered users and 16 guests