The social share url is now limited to 100 chars. When utilizing several undocumented but appearantly functional parameters for the facebook sharer.php the crafted url will be longer. To accommodate this I tried to added this line
#maxlength => 255
to the url-array in include/social_share.networks.inc at line 169. This does work as required. Now I can include longer strings. But the social share networks dialog is now a bit too wide. Didn't spend time to solve that - I'm rather new to Drupal coding.
To prevent my site from breaking when the social share module is updated without this addition, I created an additional module which adds the line to the array afterwards using the alter_form function. I don't know if this is the recommended approach.
Comment | File | Size | Author |
---|---|---|---|
#2 | fix_url_length-2106075-2.patch | 613 bytes | willvincent |
Comments
Comment #1
willvincent CreditAttribution: willvincent commentedThe recommended method would be to create a patch, and post it here, so that it can be used be everyone else, and applied to the code in the repository.
See these links for more detail:
Comment #2
willvincent CreditAttribution: willvincent commentedHere is a patch.
Please review.
Comment #3
kscheirer'#size' => 100
doesn't actually set the maximum string length, that's just the size to use when displaying the form element. See https://api.drupal.org/api/drupal/developer%21topics%21forms_api_referen....However, the default maxlength is 128, so this patch definitely makes it bigger :) Looks like a decent patch to me, especially since the db storage is a blob more than capable of handling it. IE starts having problems with URLs over 2000 characters, so you might use that value instead.
Comment #4
oldenboom CreditAttribution: oldenboom commentedThanks for the patch. Tried it and the result is similar to my alter_form solution. So it works as expected. I consider this minor issue solved when applied to the trunk.
Comment #5
willvincent CreditAttribution: willvincent commented