Giter Site home page Giter Site logo

Comments (8)

Eromera avatar Eromera commented on August 30, 2024 1

Hi again, I believe the problem is related to an incompatibility with Windows, I believe all paths in your php code have slashes in the unix-way so folder creation fails. Am I right? If so, do you think it would be easy making all windows compatible?

from dolibase.

Eromera avatar Eromera commented on August 30, 2024 1

Effectively the problem is due to compatibility in the slashes, but apparently it's not needed to change all slashes in module.py to make it work, just this function in functions.php and php makes it work for the rest:

function getDolibarrRootDirectory()
{
	$path = defined(__DIR__) ? __DIR__ : dirname(__FILE__); // should be: .../dolibarr/dolibase/builder/lib
	$parts = explode('\\', $path);
	array_splice($parts, -3); // remove '/dolibase/builder/lib'
	$root_path = implode('\\', $parts);

	return $root_path;
}

from dolibase.

AXeL-dev avatar AXeL-dev commented on August 30, 2024 1

I think the warning should be fixed on version 2.9.8.
For the widget/page tutorials, not yet, but it's a pretty cool idea, i guess that a video series about how to code a module from scratch using all dolibase features would be much better, otherwise you can try playing with the left panel & testing the builder features by yourself if you want.

Edit: you will find here a video about widget creation.

from dolibase.

AXeL-dev avatar AXeL-dev commented on August 30, 2024

Can you check if it works now? (using github version)

from dolibase.

AXeL-dev avatar AXeL-dev commented on August 30, 2024

In fact, the problem was more exactly on this line
https://github.com/AXeL-dev/dolibase/blob/78da77897b023699af9230ec9020c163b8a5dc7b/builder/lib/functions.php#L108

Because / directory separator works fine on windows too when using PHP, the only matter was that on windows the $path variable value will be something like: C:\wamp\www\dolibarr\dolibase\builder with backslashes & on linux : /opt/lamp/htdocs/dolibarr/dolibase/builder with simple slashes, so since the explode function was using only simple slashes / to separate the path parts, it simply fails on windows.

Now, it should work properly on both windows & linux.

from dolibase.

Eromera avatar Eromera commented on August 30, 2024

Thanks, how can I work directly with the github version? Can I just download the github to the dolibarr folder and do git pulls there for this module? Or how do you normally work with it?

from dolibase.

AXeL-dev avatar AXeL-dev commented on August 30, 2024

Welcome, i already updated the Dolibase installer, so you can simply update the module & after that disable + re-enable it (to refresh the dolibase framework files).

Solution 2 (using github version): download dolibase zip file from here then delete your old dolibase folder from your dolibarr root directory (it should be in /dolibarr/dolibase or /dolibarr/htdocs/dolibase) & finally replace it with the extracted one from the master.zip file.

from dolibase.

Eromera avatar Eromera commented on August 30, 2024

Thanks! It seems to work now. However I keep getting a warning when I select any "Page" item on the left:
Warning: Invalid argument supplied for foreach() in C:\dolibarr\www\dolibarr\htdocs\dolibase\builder\lib\functions.php on line 185
Is this the expected behaviour?

Additionally, do you have some quick tutorial/video about how to use the left panel (e.g. widgets / page) to create a module? Thanks!

from dolibase.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.