addon-grocy icon indicating copy to clipboard operation
addon-grocy copied to clipboard

Create product from Inventory screen, or change language, takes you to a 404 page

Open igorsantos07 opened this issue 1 year ago • 10 comments

Problem/Motivation

When you create a product from the Inventory screen, it continues into a 404 page. Also, if you go to User Settings (at the :wrench: on the corner) and change the language, you're also redirected to a 404.

I think this happens somewhere else as well, but I can't remember right now the other screen.

Expected behavior

I tested this in the live Grocy demo and it takes you back to the Inventory page, as expected. I'm not sure if the problem is because in HA it runs on a subpath.

Actual behavior

It looks like a root path problem; the redirect in my instance goes to http://hass.local:8123/api/hassio_ingress/tBExf64mMbmSzXstfKLypj9J46CeBeoT1HMJZ-DIgX4//api/hassio_ingress/tBExf64mMbmSzXstfKLypj9J46CeBeoT1HMJZ-DIgX4/inventory?flow=InplaceNewProductWithName&&product-name=teste%202 (note the repeated /api/hassio_ingress)

Steps to reproduce

  1. go to Inventory
  2. write a non-existing product on the first field
  3. press enter
  4. a popup shows up; select "add as new product"
  5. fill in any required fields on the "new product" screen
  6. press "save & continue"
  7. get sent to a 404 page

Proposed changes

I wonder if it's a problem of redirecting to a relative path (and thus, should be fixed in core Grocy), or related to the patches made in the add-on (as pointed by the veeery kind maintainer at https://github.com/grocy/grocy/issues/2379)

igorsantos07 avatar Nov 15 '23 01:11 igorsantos07

After stumbling upon Grocy's config file, I wonder if the initial patch from #157 couldn't be better handled by using either BASE_URL, BASE_PATH or even DISABLE_URL_REWRITING... Although those options seem to exist (2018, 2020) way before #157 (2021) and the mention of a "brain-damaged handling of relative URLs" seems to make sense lol

igorsantos07 avatar Nov 15 '23 22:11 igorsantos07

stale-proof comment

igorsantos07 avatar Dec 15 '23 19:12 igorsantos07

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Jan 15 '24 08:01 github-actions[bot]

stale-proof comment

igorsantos07 avatar Jan 20 '24 00:01 igorsantos07

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Feb 19 '24 08:02 github-actions[bot]

stale-proof comment

igorsantos07 avatar Feb 20 '24 18:02 igorsantos07

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Mar 23 '24 08:03 github-actions[bot]

stale-proof comment

igorsantos07 avatar Mar 25 '24 17:03 igorsantos07

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Apr 25 '24 08:04 github-actions[bot]

stale-proof comment

igorsantos07 avatar Apr 26 '24 18:04 igorsantos07

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Jun 18 '24 08:06 github-actions[bot]