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

Profile picture uploads fail when using a preparse field in an user #85

Open
mikesnoeren opened this issue Sep 21, 2022 · 0 comments
Open

Comments

@mikesnoeren
Copy link

I am working on a website where all users have a public profile that is editeable by the user from the front-end.
Because users don't have slugs natively I decided to generate one using a preparse field.

The field contains the following twig code:

{{ (element.fullName ?? element.id)|kebab|ascii }}

And in my code I use the following, which checks if current user belongs to current page.

{% set user_on_this_page = craft.users.userSlug(userSlug ?? currentUser.userSlug).one() %}
{% if not user_on_this_page %}
    {% exit 404 %}
{% endif %}

The code above works fine, but the edit-profile form doesn't.
As long as the preparse field is present I am unable to upload a picture to craft, so users can't change their profile pictures, all other form functionalities work fine..

I've opened a support ticket with Craft and they confirmed the issue is within the preparse field and then asked me to make this bug report.

If needed for debugging, I am willing to send my project file, edit-profile template and composer files.

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

1 participant