Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lolandese’s picture

Title: Make the email address valid input for user ID using the API method 'flickr.people.findByEmail' » Accept email as identifier and show human readable Flickr username instead of ID-number
Status: Active » Needs review
FileSize
10.45 KB

The function flickr_user_find_by_identifier takes care of converting a username or email into a valid NSID (user identifier). It is used by the blocks but on the Flickr settings page submitting an email address resulted in:

Flickr error 1: User not found
some.valid@email.com is not a Flickr user id and it does not appear to be a valid user name.

The attached patch:

  • substitutes all functions flickr_user_find_by_username with flickr_user_find_by_identifier except in the last function itself (so it is still needed). Now also an email address is accepted on the settings page.
  • adds a validation to the block configuration on a valid Flickr User ID to be submitted (ID number, username or email).
  • replaces emails or usernames (that might change at any given time) with a stable nsid (Flickr ID number) on submit of the Flickr settings (that was the D6 behaviour). The submit function of the Flickr settings form now gets called. This wasn't the case, so also the clean up of data (trim) has been restored.
  • all Flickr user ID's are rendered in admin forms (settings, block config) as Flickr usernames. 'Maria Emanuela' is human readable, '43937662@N05' is not. Internal the module still uses the Flickr ID number as it is more reliable.
  • corrects a non breaking undefined index error on blocks 1 and 4 that went in with a previous commit on #2023103: Added Media Type (all, photos, videos) filter in Block config.

Thanks.

lolandese’s picture

TO DO:

  • Extend this also for the user account edit page.
  • Precede form error messages with the field name for which the apply.
lolandese’s picture

Reroll against the latest dev.

Added Field names for block related error messages.

We did not extend to the user edit page that already accepts email, username and NSID as identifiers. Because they are also stored in all forms, using the NSID only as done for the blocks and default Flickr user would potentially break existing sites.

We took the opportunity to give the blocks more consistent and logical names but only in the block admin page, not the block titles themselves.

lolandese’s picture

TO DO:
Test behaviour on an existing site. Does it break something when upgrading?

lolandese’s picture

Reroll. In block config human readable user ID did not appear (NSID instead) if no default user ID was given in Flickr settings.

Corrected.

lolandese’s picture

Status: Needs review » Fixed

Existing blocks remain unaltered until opening their config page. This seems like acceptable behaviour as the user ID that is existing will be accepted as new input.

http://drupalcode.org/project/flickr.git/commitdiff/fb4a822

lolandese’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)
lolandese’s picture

Status: Patch (to be ported) » Needs review
FileSize
9.97 KB
lolandese’s picture

Status: Fixed » Closed (fixed)

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