Most Powerful Open Source ERP

Guideline Never Use GetPath To Retrieve A Url In ERP5

Absolute and physical path may differ.
  • Last Update:2017-04-05
  • Version:001
  • Language:en

Never Use GetPath To Retrieve A Url In ERP5

Use absolute_url_path instead or absolute_url, because getPath only returns the path of an object in the OFS. This means the physical path. Whereas absolute_url_path takes into account all virtual hosting configuration. absolute_url includes the host part of the URL (http://hostname/url/to/object) while absolute_url_path only returns the user URL (/url/to/object).

Good Examples:

Bad Example: