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

"Customer can login to the store" checkbox bug in the customer admin #10951

Closed
mikemix opened this issue Dec 16, 2019 · 3 comments · Fixed by #11048
Closed

"Customer can login to the store" checkbox bug in the customer admin #10951

mikemix opened this issue Dec 16, 2019 · 3 comments · Fixed by #11048
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced. Stale Issues and PRs with no recent activity, about to be closed soon.

Comments

@mikemix
Copy link
Contributor

mikemix commented Dec 16, 2019

Sylius version affected: 1.6.2

Description
Even though customer has an account, the "user can login" checkbox is not checked.

Steps to reproduce

  1. Go to the customer admin
  2. Type: first name, last name and the email, DON'T check the "user can login" checkbox
  3. Press save and wait for the page to reload
  4. Check user can login checkbox, type a password and press save
  5. Notice the checkbox is NOT checked

When you check it, the form disappears LOL ! This bug makes my clients go crazy.

Peek 2019-12-16 19-38

@mikemix
Copy link
Contributor Author

mikemix commented Dec 16, 2019

Bug spotted! In the @SyliusAdmin/Customer/_form.html.twig you have:

{% if customer.user is empty or customer.user.id is null %}

The empty test will always return true if the account exists! From the documentation:

For objects that implement the __toString() magic method (and not Countable), it will check if an empty string is returned.

Should be:

{% if customer.user is null or customer.user.id is null %}

or simply

{% if customer.user.id|default() %}

@Zales0123 Zales0123 added the Potential Bug Potential bugs or bugfixes, that needs to be reproduced. label Dec 17, 2019
@Zales0123
Copy link
Member

Indeed there is a bug. Are you willing to open a PR with the fix? Regarding a test, we should probably add some scenario in this file, with some new step like And customer should be able to log in to the store with the checkbox check

hatem20 added a commit to hatem20/Sylius that referenced this issue Jan 20, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Jan 27, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Jan 27, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Jan 27, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Mar 3, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Mar 10, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Mar 17, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue May 11, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
@stale
Copy link

stale bot commented May 30, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Issues and PRs with no recent activity, about to be closed soon. label May 30, 2020
@stale stale bot closed this as completed Jun 6, 2020
hatem20 added a commit to hatem20/Sylius that referenced this issue Jun 14, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Jun 16, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Jun 16, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
hatem20 added a commit to hatem20/Sylius that referenced this issue Jul 29, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
lchrusciel added a commit that referenced this issue Aug 10, 2020
… (hatem20)

This PR was merged into the 1.7 branch.

Discussion
----------

If applied, this commit will

-make sync behavior works on both customer and shop user,
resulting in username will never by setting username value whenever
shop user or customer is inserted or updated.

| Q               | A
| --------------- | -----
| Branch?         | 1.6 or master <!-- see the comment below -->
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | fixes #10951
| License         | MIT

I could have used the solution proposed here 
#10951 (comment)
but it might be better if the username is always in sync with customer email

Commits
-------

924c819 Bug #10951 [Account] fix sync username with customer email
lchrusciel added a commit to Sylius/SyliusCoreBundle that referenced this issue Aug 10, 2020
… (hatem20)

This PR was merged into the 1.7 branch.

Discussion
----------

If applied, this commit will

-make sync behavior works on both customer and shop user,
resulting in username will never by setting username value whenever
shop user or customer is inserted or updated.

| Q               | A
| --------------- | -----
| Branch?         | 1.6 or master <!-- see the comment below -->
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | fixes #10951
| License         | MIT

I could have used the solution proposed here 
Sylius/Sylius#10951 (comment)
but it might be better if the username is always in sync with customer email

Commits
-------

924c819e08d475618327ff4ce449f0a7a179512a Bug #10951 [Account] fix sync username with customer email
lchrusciel added a commit that referenced this issue Aug 12, 2020
* 1.7:
  Fix docs for custom resource controllers
  [Documentation] fix typo in fixture docs
  Bug #10951 [Account] fix sync username with customer email
lchrusciel added a commit that referenced this issue Aug 12, 2020
…atem20)

This PR was merged into the 1.7 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.7 
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | #10951
| License         | MIT

I added spec as request in #11048

<!--
 - Bug fixes must be submitted against the 1.7 branch (the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

c5e245f [Account] Add spec to sync username with customer email
foxou33 pushed a commit to foxou33/Sylius that referenced this issue Aug 14, 2020
if applied, this commit will

-make sync behaviour works on both customer and shop user,
resulting in username will never by setting username value whenever
shopuser or customer are inserted or updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced. Stale Issues and PRs with no recent activity, about to be closed soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants