Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.29k stars 2.74k forks source link

Bug in 7.0.0: Variants module shows "Loading..." forever #8255

Closed code-chicken closed 6 years ago

code-chicken commented 6 years ago

Bug

Variants cannot be created because list of values (ex. colors: red, green, blue) is not being shown. Instead there is "loading..." forever.

Environment

Expected and actual behavior

Expected: Adding new variants should show list of possible values Actual: Shows "loading..." forever.

Steps to reproduce the behavior

Edit product Add variant Select variant attribute

image

code-chicken commented 6 years ago

Maybe the following information helps: After some investigation I found out that in the developer tools window in Chrome I get the following error message in the Console window:

Failed to load http://erp-test/variants/ajax/get_attribute_values.php?id=3: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://erp-test.domain.com' is therefore not allowed access.

I replaced the real domain name with "domain.com". However: It seems, that only the host name is being used to load the JavaScript. Actually we use the FQDN in the address line in the browser. For the reason that in this case the domain name is our local domain, we were able to workaround the problem by only entering the hostname (without the local domain name) in the browsers address line.

Hope this helps for fixing the problem.

image

withheld commented 6 years ago

Have you tried checking your Content Security Policy? *and $dolibarr_main_url_root in conf.php

code-chicken commented 6 years ago

Thank you, that was it! 👍 In the conf.php there was the following entry: $dolibarr_main_url_root='http://erp-test';

However, in the browser we entered an URL like the following: http://erp-test.ourdomain.local

Changing the conf.php entry to a FQDN like this $dolibarr_main_url_root='http://erp-test.ourdomain.local'; solved the problem.

Anyway, we never had any problems concerning this URL-thing before.

Thank you again.

withheld commented 6 years ago

Your welcome.