Not able to enable invoice numbering module in 3.5

Hello,

I am using version 3.5 beta. I am trying to enable numbering module mercure for invoice. But it gives me “Forbidden, You don’t have permission to access /path/admin/facture.php on this server.”

Can you please tell me why this is happening?

Did you try with 3.5 stable instead.

Hi

I’m having the same problem in version 3.6.1.

Any ideas?

Hi,

I’m having the same problem and I think I know why.
The problem is scandir parameter in the url

I suppose that your server (and mine too) is blocking any request having scandir parameter for security reasons. To check that just try this url on you domain:

and you should get “Forbidden. You don’t have permission to access / on this server.”

But there is a kind of workaround - remove this parameter from the url and your module will be set!
Before:

After:

As simple as that, if you get Forbidden message just modify you url by removing that parameter and hit enter.
This should work for any other actions even if they use this parameter like activating Invoice documents models: ODT/ODS

I know this is annoying but I’m afraid there is nothing you can do about.

Well I was wrong about setting Invoice documents models to ODT by removing scandir parameter. It will activate it but you won’t be able to create an ODT Invoice.
But there is a quick fix for it and actually a permanent fix for that issue:

  1. Open /htdocs/admin/facture.php in any text editor ( like Notepad or better Notepad++)
  2. Replace this text

scandir=
with

scan_dir=
3) Find

$scandir = GETPOST('scandir','alpha');
and replace it with

$scandir = GETPOST('scan_dir','alpha');
4) Save the file and reload the page

Unfortunately there are many files using the same parameter so ideally you should do the same steps for these files too:
/htdocs/admin/commande.php
/htdocs/admin/contract.php
/htdocs/admin/dons.php
/htdocs/admin/expedition.php
/htdocs/admin/fichinter.php
/htdocs/admin/livraison.php
/htdocs/admin/propal.php
/htdocs/admin/supplier_invoice.php
/htdocs/admin/supplier_order.php
/htdocs/projet/admin/project.php
/htdocs/societe/admin/societe.php