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

dev/core/482 standardize contact edit form delete block behavior #13169

Merged
merged 2 commits into from
Dec 4, 2018

Conversation

elisseck
Copy link
Contributor

@elisseck elisseck commented Nov 28, 2018

Overview

When adding a new contact via the "New Individual", "New Organization" etc forms, or editing a contact, the website blocks allow a user to delete a block even if it's the only one left. Afterwards, the user is not able to re-create a website block. This is non-standard for this form i.e. Phone Number, Email, IM do not let a user delete a block if it's the only one left.

Relevant issue: https://lab.civicrm.org/dev/core/issues/482

Before

Users can delete the last website block, breaking their ability to add a website.
image

After

Users are not given the option to delete the last website block, which is the standard behavior for this form.
image

Technical Details

The js to create a new block relies on an existing block of that type to copy. If statement added is present in the templates for phone, IM, email blocks but was missing in the website block template.

@civibot
Copy link

civibot bot commented Nov 28, 2018

(Standard links)

@civibot civibot bot added the master label Nov 28, 2018
@elisseck
Copy link
Contributor Author

While looking at a different, possibly related issue I realized that the website inline form has a different template with the same issue. My second commit should resolve that bit as well.

@eileenmcnaughton
Copy link
Contributor

test this please

1 similar comment
@eileenmcnaughton
Copy link
Contributor

test this please

@monishdeb
Copy link
Member

This change makes sense, it is as per how we are redendering delete icon for other fields, as in:

templates//CRM/Contact/Form/Edit/IM.tpl:44:    {if $blockId gt 1}
<a class="crm-delete-inline crm-hover-button" href="#" title="{ts}Delete IM{/ts}"><span class="icon delete-icon"></span></a>
templates//CRM/Contact/Form/Edit/OpenID.tpl:42:    {if $blockId gt 1}
templates//CRM/Contact/Form/Edit/Phone.tpl:51:  {if $blockId gt 1}

Checked in my local works for me :
screen shot 2018-12-05 at 12 11 57 am

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

Successfully merging this pull request may close these issues.

4 participants