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

Consolidate CustomData code into shared tpl #11857

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

There is a lot of code replication rendering custom data fields. In preparation for exposing for more entities I am consolidating the template files

Before

After

No change - but adding screenshots to show...
screenshot 2018-03-22 19 34 01
screenshot 2018-03-22 19 34 41
screenshot 2018-03-22 19 34 46
screenshot 2018-03-22 19 35 55
screenshot 2018-03-22 19 36 06

Technical Details

The only change that I found in function was that the delete icon was originally in a
table on contact edit but afterwards it was not. However the UI looked the same - ie the table in got stripped - this shows up when using the contact edit form & there is a delete icon - ie the below is 'after'

-          <table class="no-border">
-            <tr>
-              <a href="#" class="crm-hover-button crm-custom-value-del" title="{ts 1=$cd_edit.title}Delete %1{/ts}"
-               data-post='{ldelim}"valueID": "{$tableID}", "groupID": "{$group_id}", "contactId": "{$contactId}", "key": "{crmKey name='civicrm/ajax/customvalue'}"{rdelim}'>
-                <span class="icon delete-icon"></span> {ts}Delete{/ts}
-              </a>
-              <!-- crm-submit-buttons -->
-            </tr>
-          </table>

screenshot 2018-03-22 19 33 02

Comments

@jitendrapurohit @mattwire ping

@eileenmcnaughton
Copy link
Contributor Author

test this please

@jitendrapurohit
Copy link
Contributor

Loaded multiple pages and looks fine w.r.t display on Advanced Search and contact summary page. While testing, I found some issues after applying this patch -

  • Delete action doesn't work for multi-valued custom field. To replicate - add a multi-valued custom field for Contacts and display it Inline. Try to delete a custom value from Edit Contact link and save the Form. The field value is displayed as it is on the contact summary page.

  • Another <set name> record link incorrectly shown for multi-valued custom field displayed as Tab with Table. To replicate - change the above set to display as Tab with table.

    • Navigate to the contact summary page -> Custom field tab and try to add a value.
    • A link is displayed on the bottom of the page Another <set name> record which I think is meant for Inline display and should not be shown here.

image

@eileenmcnaughton
Copy link
Contributor Author

Thanks @jitendrapurohit ! I've just pushed a fix for the delete issue - am looking at the other points now

 The only change that I found in function was that the delete icon was originally in a
 table on contact edit but afterwards it was not. However the UI looked the same
@eileenmcnaughton
Copy link
Contributor Author

@jitendrapurohit I found & fixed the second of those items too

Copy link
Contributor

@jitendrapurohit jitendrapurohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the listed issues seems to be fixed 👍. Don't see any more issues with the PR.

@colemanw colemanw merged commit ce5736d into civicrm:master Mar 22, 2018
@eileenmcnaughton eileenmcnaughton deleted the cust_data_any branch March 22, 2018 22:12
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