# Path problem ? Issue to modify new module with module builder

**URL:** <https://www.dolibarr.org/forum/t/path-problem-issue-to-modify-new-module-with-module-builder/24622>\
**Category:** Other native modules\
**Tags:** Issue\
**Created:** [November 29, 2023, 11:53am UTC](https://www.dolibarr.org/forum/t/path-problem-issue-to-modify-new-module-with-module-builder/24622 "2023-11-29T11:53:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mamba](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@Mamba](https://www.dolibarr.org/forum/u/Mamba)\
**Post date:** [November 29, 2023, 11:53am UTC](https://www.dolibarr.org/forum/t/path-problem-issue-to-modify-new-module-with-module-builder/24622/1 "2023-11-29T11:53:36Z")

</div>

Hello Dolibarr community,

I currently create a new module with module builder (testmar4), everything goes well. But now I have trouble to modify it.  
When I create a new objet (animal) it doesn’t appear on the left menu even if :

1. the menu part of description file is updated as well as the menu interface :

```auto
	// Main menu entries to add
		$this->menu = array();
		$r = 0;
		// Add here entries to declare new menus
		/* BEGIN MODULEBUILDER TOPMENU */
		$this->menu[$r++] = array(
			'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
			'type'=>'top', // This is a Top menu entry
			'titre'=>'ModuleTestmar4Name',
			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
			'mainmenu'=>'testmar4',
			'leftmenu'=>'',
			'url'=>'/testmar4/testmar4index.php',
			'langs'=>'testmar4@testmar4', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
			'position'=>1000 + $r,
			'enabled'=>'isModEnabled("testmar4")', // Define condition to show or hide menu entry. Use 'isModEnabled("testmar4")' if entry must be visible if module is enabled.
			'perms'=>'1', // Use 'perms'=>'$user->hasRight("testmar4", "animal", "read")' if you want your menu with a permission rules
			'target'=>'',
			'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
		);
		/* END MODULEBUILDER TOPMENU*/
		/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT*/

		/*LEFTMENU ANIMAL*/
		$this->menu[$r++]=array(
			'fk_menu'=>'fk_mainmenu=testmar4',
			'type'=>'left',
			'titre'=>'Animal',
			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
			'mainmenu'=>'testmar4',
			'leftmenu'=>'animal',
			'url'=>'/testmar4/animal_list.php',
			'langs'=>'testmar4@testmar4',
			'position'=>1000+$r,
			'enabled'=>'$conf->testmodule->enabled',
			'perms'=>'1',
			'target'=>'',
			'user'=>2,
		);
        $this->menu[$r++]=array(
            'fk_menu'=>'fk_mainmenu=testmar4,fk_leftmenu=animal',
            'type'=>'left',
            'titre'=>'List Animal',
            'mainmenu'=>'testmar4',
            'leftmenu'=>'testmar4_animal_list',
            'url'=>'/testmar4/animal_list.php',
            'langs'=>'testmar4@testmar4',
            'position'=>1000+$r,
            'enabled'=>'$conf->testmar4->enabled',
            'perms'=>'1',
            'target'=>'',
            'user'=>2,
        );
        $this->menu[$r++]=array(
            'fk_menu'=>'fk_mainmenu=testmar4,fk_leftmenu=animal',
            'type'=>'left',
            'titre'=>'New Animal',
            'mainmenu'=>'testmar4',
            'leftmenu'=>'testmar4_animal_new',
            'url'=>'/testmar4/animal_card.php?action=create',
            'langs'=>'testmar4@testmar4',
            'position'=>1000+$r,
            'enabled'=>'$conf->testmar4->enabled',
            'perms'=>'1',
            'target'=>'',
            'user'=>2
        );

		/*END LEFTMENU ANIMAL*/
		/* END MODULEBUILDER LEFTMENU MYOBJECT */

```

1. Interface show that the object is well created

However no left menu is showed  
Yet I can access the animal create or animal list if I modify the URL.

I also try to add setup in mymodule/admin/, I can see that I have now two settings but the new one isn’t accessible :  
Not Found The requested URL was not found on this server.  
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.  
 ![Capture du 2023-11-29 12-45-48](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/c/cd87c79d3ef9e5160fffb026d1fcbe19ddc018df.png)

(I follow the tutorial [Développement module - Dolibarr ERP CRM Wiki](https://wiki.dolibarr.org/index.php?title=D%C3%A9veloppement_module))  
And I noticed that the URL is wrong : /admin/testmar4\_setupapage.php@testmar4 as it should be custom/testmar4/admin/testmar4\_setupapage.php@testmar4.

That’s why I think I have a path problem but I don’t know why.  
If you have any idea, please feel free to help me !  
Thanks ! 🙏

Dolibarr version 18.0.0

---

<div class="post-metadata">

**Author:** ![mgribaudo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/mgribaudo/32/3096_2.png) [@mgribaudo](https://www.dolibarr.org/forum/u/mgribaudo)\
**Post date:** [December 15, 2023, 10:27am UTC](https://www.dolibarr.org/forum/t/path-problem-issue-to-modify-new-module-with-module-builder/24622/2 "2023-12-15T10:27:21Z")

</div>

Hi,  
I confess that I also always have problems when I have to create the menu items, the documentation is not clear and the pre-compiled code in the Module-descriptor does not cover all the needs.  
When I get stuck, I usually try to work both on the descriptor and directly on the llx\_menu table, I’ve always succeeded 🙂

---

<div class="post-metadata">

**Author:** ![Mamba](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@Mamba](https://www.dolibarr.org/forum/u/Mamba)\
**Post date:** [December 17, 2023, 7:39pm UTC](https://www.dolibarr.org/forum/t/path-problem-issue-to-modify-new-module-with-module-builder/24622/3 "2023-12-17T19:39:33Z")

</div>

Hello and thanks for the tips.

I solve the problem by replacing my ModuleBuilder files. I was working on a test instance and I noticed that ModuleBuilder was different from my production instance. ModuleBuilder from prod works great, I just quickly saw that the difference between the two versions were about paths (absolute or not).

---

<div class="post-metadata">

**Author:** ![ProMary](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@ProMary](https://www.dolibarr.org/forum/u/ProMary)\
**Post date:** [February 14, 2025, 9:52am UTC](https://www.dolibarr.org/forum/t/path-problem-issue-to-modify-new-module-with-module-builder/24622/4 "2025-02-14T09:52:44Z")

</div>

> [@Mamba](#):
>
> I solve the problem by replacing my ModuleBuilder files. I was working on a test instance and I noticed that ModuleBuilder was different from my production instance. ModuleBuilder from prod works great, I just quickly saw that the difference between the two versions were about paths (absolute or not).

I don’t understand what you did exactly can you explain?
