Sorry if this was already dealt with and my search-fu failed. The icons are showing up fine on links that go off-site, but going to admin/config/user-interface/extlink spits up:

Recoverable fatal error: Argument 1 passed to drupal_attributes() must be an array, string given, called in [...]/includes/theme.inc on line 1515 and defined in drupal_attributes() (line 2222 of [...]/includes/common.inc).

Checked Apache error logs and found nothing relevant.

If there isn't a fix I've managed to miss I'll try to have a crack at it tomorrow, if I can work out where to start looking! :)

It was working fine in alpha7 by the way, just didn't seem to like my beta1.

CommentFileSizeAuthor
#4 extlink-936816-4.patch1.39 KBloganfsmyth
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ryivhnn’s picture

Okay, think I fixed it. Well the admin page is popping up again anyway :)

Changed line 46ish in extlink.module from

'#description' => t('Places an !icon icon next to external links.', array('!icon' => theme_image(drupal_get_path('module', 'extlink') .'/extlink.png')))

to

'#description' => t('Places an !icon icon next to external links.', array(
    '!icon' => theme_image(array(
      'path' => drupal_get_path('module', 'extlink') . '/extlink.png',
      'alt' => t('external links icon'),
      'attributes' => '')
    )
   )
  )

Ditto the mailto below it:

'#description' => t('Places an !icon icon next to mailto links.', array('!icon' => theme_image(drupal_get_path('module', 'extlink') .'/mailto.png'))),

to

'#description' => t('Places an !icon icon next to external links.', array(
    '!icon' => theme_image(array(
      'path' => drupal_get_path('module', 'extlink') . '/mailto.png',
      'alt' => t('email links icon'),
      'attributes' => '')
    )
   )
  )

Please excuse my dodgy formatting, I was getting confused with the nested arrays :) Also had to set the "attributes" thing to blank, I'm not actually sure what it does but it was complaining about being undefined.

quicksketch’s picture

Status: Active » Needs review

Thanks, yep this change makes sense to me. In D7 you have to explicitly specify each parameter's name.

yourtube’s picture

Fix worked for me too. Thanks!

loganfsmyth’s picture

FileSize
1.39 KB

Thanks for the fix, ryivhnn! I rolled a patch to make life easier for people.

Christopher Riley’s picture

Thanks for the fix as well as the patch works perfectly.

quicksketch’s picture

Status: Needs review » Fixed

Thanks guys, committed. The only difference I made was that 'attributes' should always be an array instead of a string. Not sure why D7 is requiring an empty value at all here, but it works.

Status: Fixed » Closed (fixed)

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

Dave Reid’s picture

Actually, this needs to be really fixed as theme functions shouldn't be called directly. See #1004734: Use theme('image', rather than theme_image( for the follow-up.