Hi there!
Flickr.css always added then used 'Flickr Block' with images, even if the 'Use flickr.css' option is not selected on the settings page.
See 358 row in the flick_block.module, it should be:

<?php
/**
 * Implements hook_block_view().
 */
function flickr_block_view($delta = '') {
  // Determine the setting to use flickr.css or not.
  if (variable_get('flickr_css', 1)) {
    drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr.css');
  }
?>

Comments

lolandese’s picture

Status: Active » Needs review
StatusFileSize
new3.4 KB

Good catch.

It even seems that drupal_add_css is only needed once per page load. This is done already in flickr.module in the hook_init of line 23. It can therefore be safely removed in all other files.

Furthermore, it seems logical to apply this also on /flickr_tags.css, so we wrap that in a conditional if as suggested.

Thanks.

Searching 24 files for "drupal_add_css"

/home/martin/www/beige/sites/all/modules/flickr/block/flickr_block.module:
  362    // Determine the setting to use flickr.css or not.
  363    if (variable_get('flickr_css', 1)) {
  364:     drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr.css');
  365    }
  366    $settings = variable_get('flickr_block_' . $delta, array(

/home/martin/www/beige/sites/all/modules/flickr/field/flickrfield.module:
   23   */
   24  function flickrfield_init() {
   25:   drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr.css');
   26  }
   27  

/home/martin/www/beige/sites/all/modules/flickr/flickr.module:
   24    // Determine the setting to use flickr.css or not.
   25    if (variable_get('flickr_css', 1)) {
   26:     drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr.css', array(
   27        'group' => CSS_DEFAULT,
   28        'every_page' => TRUE,

/home/martin/www/beige/sites/all/modules/flickr/sets/flickr_sets.module:
   65    drupal_set_title(flickr_sets_page_title($user));
   66    if (variable_get('flickr_css', 1)) {
   67:     drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr.css');
   68    }
   69    $uid = $account->uid;
   ..
  104  
  105    if (variable_get('flickr_css', 1)) {
  106:     drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr.css');
  107    }
  108    $uid = $user->uid;

/home/martin/www/beige/sites/all/modules/flickr/tags/flickr_tags.module:
   55   */
   56  function flickr_tags_cloud($account, $nsid = NULL) {
   57:   drupal_add_css(drupal_get_path('module', 'flickr_tags') . '/flickr_tags.css');
   58    drupal_set_title(t('Flickr tags cloud - @name', array('@name' => $account->name)));
   59    $nsid = $account->flickr['nsid'];
   ..
   86   */
   87  function flickr_tags_list($account, $nsid = NULL) {
   88:   drupal_add_css(drupal_get_path('module', 'flickr_tags') . '/flickr_tags.css');
   89    drupal_set_title(t('Flickr tags list - @name', array('@name' => $account->name)));
   90    $nsid = $account->flickr['nsid'];
   ..
  120    global $pager_page_array, $pager_total, $pager_total_items;
  121  
  122:   drupal_add_css(drupal_get_path('module', 'flickr') . '/flickr.css');
  123    drupal_set_title(t('Flickr photos of @user tagged @tag', array(
  124      '@user' => $account->name,

8 matches across 5 files
lolandese’s picture

Component: flickr_block » Code
Status: Needs review » Fixed
Issue tags: -flickr.css block

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.