Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
Pedalman

[solved] core updater - Windows XAMPP problem

Question

I think that the damn cool core updater module has a problem with a local install of Thirtybees under XAMPP Windows.

Downloads calculated, 7632 files to download. (0.1 s)
ERROR: Failed to download files with error: fatal: path not found: \admin1/ajax-tab.php

 

Edited by Pedalman

Share this post


Link to post
Share on other sites

15 answers to this question

Recommended Posts

  • 0

I have the same issue. My XAMPP installation is in a thirtybees sub-directory. Could the path be instead read from a config setting?

Share this post


Link to post
Share on other sites
  • 0

You need two changes in /modules/coreupdater/classes/GitUpdate.php. In both cases you check whether the first char of $adminDir is a backslash and if so you remove it:

 

In the function downloadFileList() (around line 425) the following part will be changed:

        $fileList = false;
        if ($response) {
            $fileList = [];

            $adminDir = false;
            if (defined('_PS_ADMIN_DIR_')) {
                $adminDir = str_replace(_PS_ROOT_DIR_, '', _PS_ADMIN_DIR_);
				if($adminDir[0] == "\\") $adminDir = substr($adminDir,1);	/* new */
                $adminDir = trim($adminDir, '/').'/';
            }

The beginning of the function downloadFiles() (around line 870) will become:

    protected function downloadFiles()
    {
        $adminDir = false;
        if (defined('_PS_ADMIN_DIR_')) {
            $adminDir = str_replace(_PS_ROOT_DIR_, '', _PS_ADMIN_DIR_);
			if($adminDir[0] == "\\") $adminDir = substr($adminDir,1);	/* new */
            $adminDir = trim($adminDir, '/').'/';
        }

 

 

  • Thanks 3

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, musicmaster said:

You need two changes in /modules/coreupdater/classes/GitUpdate.php. In both cases you check whether the first char of $adminDir is a backslash and if so you remove it:

Yes that worked! Initially had a little issue with permissions on the cache/GitUpdateDownloads/config folder but once that was cleared then it worked. I guess my manual code update may at some time be over written by a future update.

Many thanks!

Share this post


Link to post
Share on other sites
  • 0

This has worked for me as well, thanks!

When will this be integrated into a new release of TB as I see new users are still experiencing this problem?

Share this post


Link to post
Share on other sites
  • 0
31 minutes ago, Theo said:

This has worked for me as well, thanks!

When will this be integrated into a new release of TB as I see new users are still experiencing this problem?

Windows is not officially supported platform. There are more issues like this one, both in core and in third party modules. That being said, I'm sure if you create a git pull request, someone from the tb team will integrate the fix.

On a related note -- it looks to me that a large percentage of windows related issues could be fixed if the _PS_ROOT_DIR_ and _PS_CORE_DIR_ core constants were defined with the forward slash. I don't have the windows machine to test this, though. 

 

  • Like 1

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, datakick said:

Windows is not officially supported platform. There are more issues like this one, both in core and in third party modules. That being said, I'm sure if you create a git pull request, someone from the tb team will integrate the fix.

On a related note -- it looks to me that a large percentage of windows related issues could be fixed if the _PS_ROOT_DIR_ and _PS_CORE_DIR_ core constants were defined with the forward slash. I don't have the windows machine to test this, though. 

 

I tried changing _PS_ROOT_DIR_ and _PS_CORE_DIR_. It doesn't work. On the backoffice you see it immediately as you get the typical "without-css" unformatted page display. The front office seems to work at first sight. But when you check for javascript errors you see problems there too. 

There are a few php commands - such as realpath - that produce the backslashes and they are used widely in the software. It would be a major effort to check them all out for causing problems (for example by subtracting _PS_ROOT_DIR_ ). Also - even if you did this you might find problems with modules and other third party software. Besides that it would harm the PS 1.6 compatibility. 

Share this post


Link to post
Share on other sites
  • 0

For me so far, the "slash" problem has only happened on the Core Updater as well as causing a "minor" js error on the Product Comparison page.
Other than that, I haven't encountered any other "slash" related issues on my local development environment running XAMPP on Windowz so far.
And I've been testing and playing with 30Bz extensively for a quite some time now.
The fix that MusicMaster provided earlier for the Core Updater issue (on the GitUpdater page) worked for me. Incidentally, he also provided a fix for the Product Comparison js error which also worked.
I haven't had the need yet to change any PS ROOT DIR or PS CORE DIR stuff so far...

Edited by Theo

Share this post


Link to post
Share on other sites
  • 0
On 9/16/2019 at 11:14 AM, datakick said:

it looks to me that a large percentage of windows related issues could be fixed if the _PS_ROOT_DIR_ and _PS_CORE_DIR_ core constants were defined with the forward slash.

This sounds like a good idea. Along with all the usages of realpath() @musicmaster mentioned. Catching issues at the root instead of dealing with them on each instance. Certainly quite some work, but not too hard to do.

Share this post


Link to post
Share on other sites
  • 0
On 9/17/2019 at 2:32 PM, Traumflug said:

This sounds like a good idea. Along with all the usages of realpath() @musicmaster mentioned. Catching issues at the root instead of dealing with them on each instance. Certainly quite some work, but not too hard to do.

That was not what I meant and it will destroy Windows compatibility for modules and third party software. Quite likely it will make Thirty Bees unusable for Windows users.

Prestashop is built with _PS_ROOT_DIR_ and _PS_CORE_DIR_ the way they are. The only places where we have problems until now is two places with recent code changes. That is easy to fix. Note also that what happens in the socialsharing module (storing the full server path of a file in a javascript file visible to the customer) is highly unusual.

Edited by musicmaster
  • Like 1

Share this post


Link to post
Share on other sites
  • 0

I agree with @musicmaster, since looking on e-mail warnings issue(#960) I'm running mostly local win+apache version instead of dockerized version with nginx and it runs great. I also think the problem is with just a couple of spots where this is seen, not with the core and the constants.

When I read TB is Linux only I really thought it wouldn't run on Windows at all and in the end its actually very usable.

Share this post


Link to post
Share on other sites
  • 0

Well, I am interested in learning new stuff and I want to improve my daily workflow constantly. So, instead of dealing any further with XAMPP under Windows I would like to know which is the proper way to go.

I use since years virtual machines and have stick with VirtualBox. As far as I good dig Bitnami for example hosts ready to go images for virtual machines. Especially interesting might be here the bitnami-lampstack-7.3.9-0-linux-debian-9-x86_64.ova .

I also have a nas running with XPenology and some docker containers. Is this a good idea for testing new modules and functions in TB or too complicated and less user friendly than a virtual machine. This I could take anywhere (Mac, Linus, 'Win) and blow it up with software i usually use when doing stuff on my TB install.

Share this post


Link to post
Share on other sites
  • 0

I personally prefer docker containers. That's the best way to ensure my production environment is the same as my dev environment -- the same database version, the same php version, the same services (cron, task queue, elasticsearch, redis). With docker-compose I can build and deploy the same stack anywhere, within few minutes. 

If there is a bug in my production environment, I can (almost) always reproduced it my testing environment. Because they are identical.

Of course, there's a learning curve...

Share this post


Link to post
Share on other sites
  • 0

Thank you Datakick for the nice advice.

Actually yesterday I installed some containers with macvlan and and pretty happy. But in order to get such a nice testing environment running like you suggested I need to learn much more I guess 🙂

 

Anyhow, I just noticed that GitUpdate.php has been updated and the core updater function in Thirtybees works flawless under Windows and Xampp.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...