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

Contact images broken by contact-summary.js when using Drupal 'seven' theme. #374

Open
michael-chaplin-gmcvo opened this issue Mar 8, 2019 · 7 comments

Comments

@michael-chaplin-gmcvo
Copy link

michael-chaplin-gmcvo commented Mar 8, 2019

CiviCRM 5.11.0
Shoreditch 0.1-alpha28 (required for Mosaico)
Using 'Seven' as the CiviCRM admin theme.
Contact images are briefly displayed on eg civicrm/contact/view?reset=1&cid=22437
contact-summary.js is still loaded from
sites/default/files/civicrm/extensions/org.civicrm.shoreditch-0.1-alpha28/js/contact-summary.js?r=zQ7oF

It appears to move the contact image from
< div id="crm-contact-thumbnail" >
to further up the page where it is now invisible (probably because of CSS).

If the js is blocked the image shows in the correct postion.

@Upperholme
Copy link

I'm seeing this issue with 5.10.x (and earlier versions) using Adminimal as the CiviCRM theme. The contact-summary.js file is getting loaded even though I'm only using Shoreditch for Mosaico.

@samuelsov
Copy link

I confirm the problem. We are using adminimal as the CiviCRM theme and Shoreditch for Mosaico only.

Caused by #215

@Upperholme
Copy link

"If the js is blocked the image shows in the correct position." How might I achieve this?

@michael-chaplin-gmcvo
Copy link
Author

In Chrome, inspect => network tab.
Filter so that only JS shows in list.
Reload page => now have list of JS resources
Right click contact-summary.js and use 'Block request URL'
Reload page (but contact-summary.js is blocked from loading)

jmcclelland added a commit to progressivetech/org.civicrm.shoreditch that referenced this issue Jul 8, 2019
Fix for civicrm#374 if you are only using shoreditch for mosaico.
@jmcclelland
Copy link

I just pushed a patch so that the contact summary javascript is only pulled in if the site is configured to use shoreditch throughout civicrm.

jmcclelland added a commit to progressivetech/org.civicrm.shoreditch that referenced this issue Jan 22, 2020
Fix for civicrm#374 if you are only using shoreditch for mosaico.
@deepak-srivastava
Copy link

deepak-srivastava commented Sep 8, 2020

Similar problem with us. Images don't appear at all.

If we block the js/contact-summary.js file from loading OR comment out the code in the js file, image gets displayed fine.

image

image

Site Info:
Drupal 8
CiviCRM 5.27.4
org.civicrm.shoreditch 1.0.0-beta.1

@jitendrapurohit
Copy link

Can replicate the same error on

Drupal 9.2.6
CiviCRM 5.41.1
shoreditch 1.0.0-beta.9

The reason seems to be the body class missing from D8 CiviCRM, eg, I see page-civicrm-contact-view class is added on the body of contact summary page in civi. This class is used to customise most of display in custom-civicrm.css

Since the class is missing from D9 sites, none of these css style work.

A quick workaround is to add

Civi::resources()->addScript('cj("body").addClass("page-civicrm-contact-view");');

on contact summary pages.

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

6 participants