Initial Drupal 7 upgrade
pwolanin - October 30, 2009 - 19:50
| Project: | Follow |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
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.

#1
first start on a patch
#2
committed patch #1 - will continue with further updates
#3
#4
more updates, including hook_block_X
#5
committed 2nd patch
#6
Schema descriptions are no longer translated
http://drupal.org/node/224333#schema_translation
#7
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?
#8
working on validation of URL more.
#9
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().
#10
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.
#11
@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.
#12
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:
<?php
/**
* 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?
#13
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! :)
#14
moved url validation to the other issue.
#15
@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.
#16
per discussion in IRC - just leaving as drupal_alter.
Got tabledrag sort of working.
#17
committed this patch
incl this CS class change: http://drupal.org/update/theme/6/7#clearfix
#18
Automatically closed -- issue fixed for 2 weeks with no activity.