Any news about when you plan to have a Drupal 7 version ???
Thanks

Comments

irakli’s picture

As soon as I can get to it, unless somebody can kindly provide a patch.

Most of the module code is not Drupal-dependent at all, so patch should be very easy to write. Unfortunately I can't get to it right now.

sw3b’s picture

Ok thanks !

andypost’s picture

Title: Port to Drupal 7 » Port to Drupal 7 of Short URL

Subscribe

mrsinguyen’s picture

Subscribe

chrisyates’s picture

Status: Active » Needs review
StatusFileSize
new6.77 KB

Here's a patch. Also fixed some other formatting issues (which I probably should have done separately).

-chris

anselm.marie’s picture

Subscribe

willmoy’s picture

Issue tags: +D7 porting

Sub + tag

dwhutton’s picture

subscribe

alienseer23’s picture

looking forward to this

agerson’s picture

subscribe

toxiclung’s picture

subscribe

jeffwidman’s picture

subscribe

Panic’s picture

How do you apply a patch and have it recognized as a drupal 7 module?

I replaced the shorturl.engine.inc with that patch and it still says that it's drupal 6 only

michaelfavia’s picture

@panic: youneed to patch the info and other related files as well. the info file determines the modules ability to operate on a given drupal version and the other changes make it actually work.

Panic’s picture

Ohhhh, I don't know how to do that lol
I guess I wait until a 7 version is out, since some people have it working it should be soon

Thank you for telling me what I was missing

aleksandar.jakovljevic’s picture

subscribe

badjava’s picture

subscribe

retolist’s picture

Subscribe

bsherwood’s picture

The redirect module at http://drupal.org/project/redirect says it plans on replacing most redirection type modules (ShortURL, Shurly, Path Redirect, etc...). Wouldn't it make more sense to combine your efforts so Drupal doesn't have 10 different types of redirection modules for Drupal 7 that do practically the same thing?

Taxoman’s picture

Title: Port to Drupal 7 of Short URL » D7 port of Short URL

Subscribing

pumpkinkid’s picture

subscribing

CarbonPig’s picture

subscribe

andypost’s picture

This module could work as Short URL provider so Redirect module could be just intergrated but it's functionality is different

StevenSokulski’s picture

Subscribe

summit’s picture

Hi, Would love to have a Drupal 7 version of this module please?
Anyone did the patch already and is able to winzip the D7 module please?
Thanks a lot in advance for your reply!

Greetings,
Martijn

summit’s picture

StatusFileSize
new11.77 KB

Hi,

This also needed to change: for function shorturl_admin_settings_form and for function shorturl_admin_settings_form_validate

function shorturl_admin_settings_form(&$form_state) {

to

function shorturl_admin_settings_form($form_state) {

I winzip the module for D7 with patch and above change.
Could anyone check if this is all correct please?

Greetings,
Martijn

prashantgoel’s picture

has anyone reveiwed the patch submitted by Chrisyates and Martijn I think think you must submit the patch file after porting

david.gil’s picture

Hi Summit,

i have been testing your zip module and it has a bug when you check if the url already has been shorten. the correct db query is (line 201 of shorturl.module)

//Do we already have this URL?
$existing_id = db_select('shorturl_link')
->fields('shorturl_link', array('lid'))
->condition('orig_url', $long_url)
->execute()
->fetchField();

summit’s picture

Hi David, Thanks for your improvement.
May be you also know the following.

1) Trying out the module I got a short url, but it redirects only to a url without variables.
a url like www.example.com/test/?code=12 is redirected to www.example.com/test and not to www.example.com/test/?code=12
EDIT: May be code like this somehow helps with $_Get to get the variable...: http://drupal.org/node/1316536#comment-5143202. But I am not a programmer..

2) Also using this line of code in a custom formatter:

shorturl_shorten($variables['#items'][0]['url'], TRUE);

I got a short url "lql" but for all different url's I got the same shorturl "lql"

Can you help please?
Thanks a lot in advance!
Greetings, Martijn

summit’s picture

Hi for 1) I think the problem is somehow in this function:

/**
* Given a URL, merge additional query string parts on top of it. Note: the initial URL may have its own query string before merge.
*
* @param $url
*   initial URL (must be a fully-qualitified URL!)
* @param $query_string_parts
*   Associative array of query string parts to add to the original URL (use PHP parse_str() if you need to get these from a query string).
* @return
*   URL with the merged query string or FALSE on failure.
*/
function shorturl_merge_query_string($url, $query_string_parts) {
  if (empty($query_string_parts) || !is_array($query_string_parts)) {
    return $url;
  }
  $url_parsed = parse_url($url);
  $orig_qs_parsed = array();  
  parse_str($url_parsed['query'], $orig_qs_parsed);

  // Merge
  $final_query_string_array = array_merge($orig_qs_parsed, $query_string_parts);
  $final_query_string = http_build_query($final_query_string_array, '', '&');
  
  // Resulting URL:
  $new_url = $url_parsed['scheme'] 
         . '://'
         . $url_parsed['host'] 
         . $url_parsed['path'] 
         . '?'      
         . $final_query_string;
  
  return $new_url;
}

Somehow the stuff with ?code=12 is not used in the redirect..
greetings, Martijn

cmsdave’s picture

subscribing

summit’s picture

I found the cullpit: issue: http://drupal.org/node/1309658
It is an error in the link module the query string is in the .dev version removed. In that issue there is a patch for it.
Greetings, Martijn

CarbonPig’s picture

sub

sarhugo’s picture

sub

deanflory’s picture

subscribing!

Taxoman’s picture

hi, guys, instead of "subscribing" old-style, please use the "Follow" function at the top-right here, so that the rest of us dont have to check in here in vain because of "false activity alerts"...

socialnicheguru’s picture

In the short url module there is the following page but it doesn't show up on my site.

shorturl.info:configure = admin/config/search/shorturl/configure

I am just wondering if this is an error?

berdir’s picture

StatusFileSize
new6.62 KB

Adding an updated version of the patch. Simplified the changes a bit, removed the url validity check, that breaks relative url's.

socialnicheguru’s picture

this is a little strange

patch - fails for .info file
git doesn't apply

git apply shorturl-7.x.patch
shorturl-7.x.patch:81: trailing whitespace.

shorturl-7.x.patch:102: trailing whitespace.
'q', 'l', 'i', '3', 'O', 'c', 'x', 'a', 'C', '1', 'r', 'Y',
shorturl-7.x.patch:103: trailing whitespace.
'g', '4', '2', 'T', 'b', 'j', 'D', 'W', 'Z', 'B', 'K', 'k',
shorturl-7.x.patch:104: trailing whitespace.
'0', '8', '9', 'X', 'I', '5', 'N', 'R', 'n', 'Q', 'U', 'P',
shorturl-7.x.patch:105: trailing whitespace.
'E', 'm', 'y', 'V', 'p', 'd', 'v', 'w', 'f', 'G', '7', 'A',
warning: shorturl.info has type 100644, expected 100755
error: patch failed: shorturl.info:1
error: shorturl.info: patch does not apply

berdir’s picture

the patch is against the git checkout.

aaronbauman’s picture

Status: Needs review » Needs work
StatusFileSize
new2.27 KB

I get similar errors as in #39 and the patch fails against both master and 6.x-1.x git branches.

Here's an updated version of the patch in #38 against the latest 6.x-1.x branch, without only the critical 7.x updates applied (no whitespace changes).

aaronbauman’s picture

Status: Needs work » Needs review

derp

BeaPower’s picture

any updates?

BeaPower’s picture

?

socialnicheguru’s picture

I get this error:
Warning: Parameter 1 to shorturl_admin_settings_form() expected to be a reference, value given in drupal_retrieve_form() (line 798 of /includes/form.inc).

pedrosp’s picture

Issue summary: View changes

D7 users, to use your own domain URL, you better move to https://www.drupal.org/project/shurly

summit’s picture

Hi,
Any news on porting to D7 please?
While D6 is now obsolute because of D* introducing I really need this D7 port now.
I use the function function shorturl_shorten ($long_url, $full_url = FALSE) in Custom formatter, so can't just go to other module.

Thanks for making the port in advance!
Greetings, Martijn

a8w4’s picture

Hi guys, as I needed a fast solution in order to keep the short URLs of a Drupal 6 site intact, I decided to migrate to the ShURLy module under Drupal 7. For the migration to that I created this Migrate-Module, which you can find here:

https://github.com/a8w4/drupal_shorturl_migration

Hope this helps some folks still, cheers,
Alexander