Time to start updating modules for D7. Looks like the DRUPAL-6--1 code is the most recent, so I'll roll a patch against that. In order to apply thte patch to HEAD, please sync HEAD with the 6 branch.

PS - Please create a DEV release pointing to HEAD and label as Drupal core 7.x compatible so there is a 7.x version to choose from for the issue.

Comments

pwolanin’s picture

Status: Active » Needs work
StatusFileSize
new4.4 KB

first start on a patch

pwolanin’s picture

Status: Needs work » Active

committed patch #1 - will continue with further updates

pwolanin’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
pwolanin’s picture

Status: Active » Needs work
StatusFileSize
new8.08 KB

more updates, including hook_block_X

pwolanin’s picture

Status: Needs work » Active

committed 2nd patch

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new1.49 KB

Schema descriptions are no longer translated
http://drupal.org/node/224333#schema_translation

pwolanin’s picture

StatusFileSize
new5.61 KB

API cleanup - user drupal_alter on default networks list - add site RSS as a possible network. Simplify caching.

start on regex cleanup. Do some sites provide a non http or https link?

pwolanin’s picture

Status: Needs review » Needs work
StatusFileSize
new7.53 KB

working on validation of URL more.

q0rban’s picture

Peter, thanks for all your work on this.

Can we keep the regex cleanup to this issue, so that it's in 6 & 7 branches? #538172: Refactor regex for better validation and to allow for special chars in urls

Also:

+    // We don't have an API to create new networks yet, so for now, we only
+    // call hook_follow_networks_alter().

If I'm not mistaken, there is a hook for adding new networks that I believe is called hook_follow_networks().

pwolanin’s picture

StatusFileSize
new7.76 KB

no longer need to install schema in hook_install: http://drupal.org/update/modules/6/7#install-schema

add a default link to the site's RSS feed.

pwolanin’s picture

@q0rban - the way it's written now, hook_follow_networks() only lets you add, not remove or alter. Using drupal_alter as in this patch lets other contrib module add change or remove any of the network based on the default list provided by follow.module - I think this is a more useful API to expose.

q0rban’s picture

Also, looking at your follow_build_url_regex function made me think it would make sense to move away from the simple array structure of hook_follow_networks to something more like this:

/**
 * Implementation of hook_follow_networks().
 *
 * @return
 *   An array of networks.
 */
function follow_follow_networks() {
  $items = array();

  $items['facebook'] = array(
    'title' => 'Facebook',
    'domain' => 'facebook.com',
  );
  $items['virb'] = array(
    'title' => 'Virb',
    'domain' => 'virb.com',
  );

  ...

  return $items;
}

That would allow you to pass the array to your regex validator and get the domain for each that way, without having to hard code all that garbage into the function itself, and also greater flexibility in the future for custom title callbacks and such.

Not sure if domain should be kept 'domain' or maybe it should be 'url', or 'base_url' or 'base'.

Thoughts?

q0rban’s picture

@q0rban - the way it's written now, hook_follow_networks() only lets you add, not remove or alter. Using drupal_alter as in this patch lets other contrib module add change or remove any of the network based on the default list provided by follow.module - I think this is a more useful API to expose.

Yes, but your comment said 'there is no way to create new networks', I was just clarifying that there is a way to create new networks. There is already an issue about adding the drupal_alter as well: #555636: Allow altering of networks

Thanks! :)

pwolanin’s picture

StatusFileSize
new5.72 KB

moved url validation to the other issue.

pwolanin’s picture

@quorban - generally a module does not implement it's own hooks - so letting modules just add or alter on the alter hook makes more sense to me.

pwolanin’s picture

Status: Needs work » Needs review
StatusFileSize
new7.82 KB

per discussion in IRC - just leaving as drupal_alter.

Got tabledrag sort of working.

pwolanin’s picture

Status: Needs review » Fixed
StatusFileSize
new8.33 KB

committed this patch

incl this CS class change: http://drupal.org/update/theme/6/7#clearfix

Status: Fixed » Closed (fixed)

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