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

Custom twig template may result in 500 #21

Open
absynth42 opened this issue Jan 31, 2024 · 4 comments
Open

Custom twig template may result in 500 #21

absynth42 opened this issue Jan 31, 2024 · 4 comments
Assignees

Comments

@absynth42
Copy link

So I'm evaluating HumHub and the VCard Popover plugin and I wanted to add a custom field "profile.LinkedIn-URL" to the card. This is the twig:

{% if profile.LinkedIn-URL %}
	{{ profile.LinkedIn-URL|e }}
{% else %}
	Kein LinkedIn.
{% endif %}

I can't spot any error in there but obviously this doesn't work. I can reliably cause HTTP 500 errors when trying to hover over a profile name.

Omitting a syntactically important character like the ending % before a } also leads to error messages within the popover vcards.

So I guess the bug or feature request here would be that twig templates entered in the configuration fields for profiles and possibly also spaces aren't parsed and validated before being saved and applied.

@yurabakhtin
Copy link
Contributor

@absynth42 @luke- I think this issue was fixed here #20.

Also I cannot create a profile field with internal name LinkedIn-URL:

wrong-internal-name

but it can be stored with LinkedIn_URL and then it works well with new fix.

@absynth42
Copy link
Author

Ahhh, of course, I didn't create a custom profile field, I created a custom social bookmark field. Can I access that from within a Twig template? Is that part of the user property?
And there's a documentation/ux issue hidden in your screenshot: You can add a field named "blah_blah", but the underscore "_" is by no means an "alphanumeric" character. ;-)

@yurabakhtin
Copy link
Contributor

@absynth42

I created a custom social bookmark field

Could you please tell or show how you create it?

And there's a documentation/ux issue hidden in your screenshot: You can add a field named "blah_blah", but the underscore "_" is by no means an "alphanumeric" character. ;-)

@luke- I confirm there is a validation with regexp [^a-zA-Z0-9_]. Should we update the error message "Only alphanumeric characters allowed!"?

@luke-
Copy link
Collaborator

luke- commented Feb 1, 2024

@yurabakhtin I would leave the error message as it is for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants