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

pwolanin - October 30, 2009 - 20:42
Status:active» needs work

first start on a patch

AttachmentSize
follow-D7-619276-1.patch 4.4 KB

#2

pwolanin - October 30, 2009 - 21:16
Status:needs work» active

committed patch #1 - will continue with further updates

#3

pwolanin - October 30, 2009 - 21:25
Version:6.x-1.x-dev» 7.x-1.x-dev

#4

pwolanin - October 30, 2009 - 21:57
Status:active» needs work

more updates, including hook_block_X

AttachmentSize
follow-D7-619276-4.patch 8.08 KB

#5

pwolanin - October 30, 2009 - 21:59
Status:needs work» active

committed 2nd patch

#6

pwolanin - November 2, 2009 - 16:45
Status:active» needs review

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

AttachmentSize
follow-D7-619276-6.patch 1.49 KB

#7

pwolanin - November 2, 2009 - 17:16

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?

AttachmentSize
follow-D7-619276-7.patch 5.61 KB

#8

pwolanin - November 2, 2009 - 17:54
Status:needs review» needs work

working on validation of URL more.

AttachmentSize
follow-D7-619276-8.patch 7.53 KB

#9

q0rban - November 2, 2009 - 18:21

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

pwolanin - November 2, 2009 - 18:31

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.

AttachmentSize
follow-D7-619276-9.patch 7.76 KB

#11

pwolanin - November 2, 2009 - 18:33

@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

q0rban - November 2, 2009 - 18:35

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

q0rban - November 2, 2009 - 18:38

@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! :)

#14

pwolanin - November 2, 2009 - 18:47

moved url validation to the other issue.

AttachmentSize
follow-D7-619276-10.patch 5.72 KB

#15

pwolanin - November 2, 2009 - 18:50

@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

pwolanin - November 2, 2009 - 20:18
Status:needs work» needs review

per discussion in IRC - just leaving as drupal_alter.

Got tabledrag sort of working.

AttachmentSize
follow-D7-619276-16.patch 7.82 KB

#17

pwolanin - November 2, 2009 - 20:26
Status:needs review» fixed

committed this patch

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

AttachmentSize
follow-D7-619276-17.patch 8.33 KB

#18

System Message - November 16, 2009 - 20:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.