lemmy-ui icon indicating copy to clipboard operation
lemmy-ui copied to clipboard

Regression: Prefilling `create_post` form from URL parameters no longer works

Open roobre opened this issue 1 year ago • 2 comments

Requirements

  • [X] This is a bug report, and if not, please post to https://lemmy.ml/c/lemmy_support instead.
  • [X] Please check to see if this issue already exists.
  • [X] It's a single bug. Do not report multiple bugs in one issue.
  • [X] It's a frontend issue, not a backend issue; Otherwise please create an issue on the backend repo instead.

Summary

Prior to Lemmy 1.18.0, it was possible to use parameters in the URL to load a "New Post" form with some fields prefilled, e.g.:

https://lemmy.instance/create_post?lang=en&url=https%3A%2F%foo.bar&title=Foo+Bar&community_id=1&body=Description+of+foo+bar

This was super useful for bookmarklets and "share" style URLs.

Unfortunately this does not seem to work anymore. I'm not sure if the names of the GET parameters have changed, or if this feature was dropped along the way.

Steps to Reproduce

  1. Navigate to /create_post?title=Foo+bar
  2. Observe that the Title form field is not prepopulated with Foo bar

Technical Details

N/A

Lemmy Instance Version

0.18.1

Lemmy Instance URL

https://links.roobre.es

roobre avatar Jul 11 '23 10:07 roobre

In case this helps: Taking a quick look at the git history, it might be possible that https://github.com/LemmyNet/lemmy-ui/pull/977 broke this functionality.

roobre avatar Sep 18 '23 09:09 roobre

I'm gonna toss in, I feel like this might be a bigger issue than this issue's activity would suggest. Without this functionality, third-party apps have no way to add Lemmy as a share target for an article (ie those "Share to FB", "Share to Twitter" buttons attached to many articles/sites...there's no way to add a "Share to Lemmy" button).

The friction this causes may have an impact on Lemmy adoption rate, and certainly an impact on perceived ease-of-use.

PS I recognize that due to the federated nature, a "Share to Lemmy" button would likely require an extra step to choose the instance, which adds some friction anyway. I also doubt large corporate outlets are chomping at the bit to add a "Share to Lemmy" button to their site, but certainly FOSS projects (including one that I'm working on) would probably want this functionality.

murrple-1 avatar Jan 25 '24 18:01 murrple-1

This still appears to be an issue on the latest Lemmy versions (as tested on infosec.pub). I was hoping to make a basic automation/bookmarklet for myself, but it seems like I'd have to use the API instead.

corbindavenport avatar Jun 06 '24 17:06 corbindavenport

cc @SleeplessOne1917

dessalines avatar Jun 06 '24 19:06 dessalines

Working on this now. The only thing that I think will end up different is the language, since we use IDs for those instead of the 2 character locale names.

SleeplessOne1917 avatar Jun 06 '24 22:06 SleeplessOne1917

Sweet, thx.

dessalines avatar Jun 06 '24 22:06 dessalines