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

Link previews with validation errors are silently discarded #6

Closed
verement opened this issue Nov 14, 2020 · 8 comments
Closed

Link previews with validation errors are silently discarded #6

verement opened this issue Nov 14, 2020 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@verement
Copy link

If a link preview record fails validation, for example because a URL is longer than 255 characters, the preview is silently discarded upon submitting the post.

This can be especially bewildering if the troublesome URL is for the preview image, over which the user has no control.

@luke- luke- mentioned this issue Dec 4, 2020
@luke- luke- added the bug Something isn't working label Mar 19, 2021
@luke-
Copy link
Contributor

luke- commented Mar 19, 2021

Maybe we should throw a Yii::warning in such cases?

@yurabakhtin
Copy link

@luke- I cannot understand how this module should work.
When I create a new post with text like Test http://spotify.com text I don't see the link is rendered with thumbnail icon as it is displayed on doc page. Should I enable something else to make this module works?

I run composer install successfully.
But I can run npm install without errors only if remove a comma after "doc": "docs", and if remove completely the line "euskadi31/Opengraph": "^1.0.0"`` because it seems the package doesn't exists, I got the error:

npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "euskadi31/Opengraph": name can only contain URL-friendly characters

This is a single package so if we will remove I don't see a reason to keep the package.json at all. Please correct me if I am wrong here.

@luke-
Copy link
Contributor

luke- commented Mar 22, 2021

@yurabakhtin I fixed the problem with the Composer Json, seems that ComposerV2 had a problem with the capitalization of the package name.

Can you try a composer install again?

@yurabakhtin
Copy link

@luke- Yes, in my previous comment I forgot to report about the issue in composer.json, I fixed that too on my local file without commit yet, but if you did this first then thanks, , so I could install it after the same fix
However as I wrote above the problems exist in the package.json and it seems we don't need that at all, can you please check that?

@luke-
Copy link
Contributor

luke- commented Mar 22, 2021

@yurabakhtin Yes, I think we can delete the package.json file. Does the module work for you now?

@yurabakhtin
Copy link

@luke- Yes, the problem was in redirect URL on the server side of the URL, for example, the url https://www.spotify.com/ redirects me to https://www.spotify.com/ru-ru/ so I need to use this url to test this module.

@yurabakhtin
Copy link

@luke- I have implemented to display the validation errors after fetching an URL:

fetch_errors

MR https://git.humhub.org/modules/linkpreview/-/merge_requests/1

@luke-
Copy link
Contributor

luke- commented Mar 22, 2021

@yurabakhtin Thanks & Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants