Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to delete link with webapp #1377

Closed
saiballo opened this issue Feb 16, 2022 · 8 comments
Closed

No way to delete link with webapp #1377

saiballo opened this issue Feb 16, 2022 · 8 comments
Labels
Milestone

Comments

@saiballo
Copy link

How Shlink is set-up

  • Shlink Version: 3.0.2
  • PHP Version: 8.0
  • How do you serve Shlink: Self-hosted Apache
  • Database engine used: MySQL

Summary

During installation I set "Visits threshold" to 30. If I try to delete a link in webapp (version 3.5.1) with 1 visit I read this message: "Impossible to delete short URL with short code "xxxxx", since it has more than "1" visits."

No problem if I use cli command to delete it

Current behavior

No link is deleted

Expected behavior

Link is deleted

How to reproduce

create a link and try to delete it in webapp

@saiballo saiballo added the bug label Feb 16, 2022
@acelaya
Copy link
Member

acelaya commented Feb 18, 2022

Yep, I have reproduced this. No matter the value you provide, it always sets 1.

As a short term workaround, you can manually edit the config/params/generated_config.php file, and chage this value, replacing 1 with 30 (or the value you want).

-'DELETE_SHORT_URL_THRESHOLD' => 1,
+'DELETE_SHORT_URL_THRESHOLD' => 30,

Then, delete the data/cache/app_config.php file.

@saiballo
Copy link
Author

thank you!!

@daddiofaddio
Copy link

Shlink Version: 3.0.2
Shlink Web App 3.51
PHP Version: 8.1
How do you serve Shlink: Self-hosted Nginx
Database engine used: MariaDB

I have the exact same issue as above and receive the same error message from within the web app.

However, unlike above, I also cannot delete the affected shorturls from cli. When attempting to delete via cli, I receive a message saying "[ERROR] No URL found with short code "xxxx" for domain "https://xxx/xxxx". However, the short code (same as the confirmation code entered to confirm deletion within the web app) is correct.

I tried the fix just posted on two different instances of shlink on different servers -- changed the value in config/params/generated_config.php to 'DELETE_SHORT_URL_THRESHOLD' => 100, cleared cache, restarted Nginx, php, tried using different browsers, etc., and the issues still persist on both servers.

Not sure if there is anything else I should do to have the changes take effect?

@saiballo
Copy link
Author

very strange... I edit this value in generated_config.php but without effect. I restart apache too...

@acelaya
Copy link
Member

acelaya commented Feb 18, 2022

very strange... I edit this value in generated_config.php but without effect. I restart apache too...

@saiballo I forgot to tell you also have to delete the data/cache/app_config.php file. Then it will start working.

I have updated my original comment in case I need to reference to it.

[ERROR] No URL found with short code "xxxx" for domain "https://xxx/xxxx"

@dfnsar715 This is an unrelated issue. If you have applied the mitigation described here, you will only be able to delete short URLs not in the default domain, if you explicitly pass the domain with --domain example.com.

The shlink-web-client does this automatically, that's why the error is different.

@acelaya acelaya added this to the 3.0.3 milestone Feb 18, 2022
@daddiofaddio
Copy link

After deleting app_config.php, everything works great. Thanks for the quick response and great app!

@saiballo
Copy link
Author

saiballo commented Feb 19, 2022

everything now runs great! thank you!

shlink is a great software!

@acelaya
Copy link
Member

acelaya commented Feb 19, 2022

This has now been fixed and will be released with Shlink 3.0.3

@acelaya acelaya closed this as completed Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants