Subject says it all. I only patched this mod for MySQL, so that is why I am saying it needs work. Also, requires unstalling the mod / reinstalling the mod as it involved a change to the db schema.

I chose to allow 2 rows for the url text area, so as to make it easier to see that the URL is entered (copy/past) correctly.

The patch to weblinks.install is attached, the patch to weblinks.module coming next...

Comments

mdlueck’s picture

StatusFileSize
new205 bytes

The patch to weblinks.module

hydrian’s picture

There a much easier way of dealing with this issue. The original mysql schema of 5.x-1.7 for drupal_weblinks set the url field to 155. The issue is that the weblinks.module only alllowed for 64 characters in the input field. Just update the weblinks.module to use 155.

$form['url'] = array('#type' => 'textfield',
'#title' => t('URL'),
'#default_value' => $node->url,
'#maxlength' => 155,
'#description' => t('The description can provide additional information about the link.'),
'#required' => TRUE,
);

Technically URL can be any length of characters. But the usual rule of thumb is keep them under 255 character. After that some clients may have issues. If the 155 characters if not enough for you, you can switch it up to 255. Just do a ALTER TABLE drupal_weblinks modify url varchar(255); and then update the weblinks.modules input field to 255.

hydrian’s picture

StatusFileSize
new538 bytes

Heres the diff file for the url input line change.

mdlueck’s picture

Leaving the URL as an HTML textfield rather than a textarea means that (I forget exactly) the resulting URL is shorter than what MySQL can store. Thus I changed that to a text area.

Since it is a schema change either way, I chose the textarea / text method.

theorichel’s picture

I cannot follow this anymore. Sure it is a problem that this url-field is too shoort (the description field has the same problem btw), but what should I do now: change the length manually? apply the patch? wait for the new version?

Thanks

mdlueck’s picture

I think the patch is good, at least on MySQL 4.0.x and MySQL 5.0.x.

There is alternate SQL in the code for Postgres I think, and I left that alone as we do not use that database.

Be sure to go through the module uninstall so that the web links table is removed from the database, thus when you install my version of the module the table is created with the longer column for the url.

Also, it was necessary to go to /admin/content/taxonomy from there edit the Web Links, and re-check the Web Links in the Type area. That way when you create Web Links you see the selection of Categories.

rmiddle’s picture

Status: Needs review » Fixed

Field was increased in 1.8. Marking this issue as fixed.

Thanks
Robert

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

yelloroadie’s picture

This patch is a bit of a bane to me, as now my tinyMCE shows up for the URL field when editing, and there is no easy way to set the tinyMCE not to show up just for editing weblinks - it would have to be some custom PHP code. Perhaps someone could provide this? Surely a text area is not necessary? you just copy and paste the URL, you don't need to see the whole thing?

rmiddle’s picture

Status: Closed (fixed) » Active
rmiddle’s picture

Version: 5.x-1.7 » 5.x-1.15
mdlueck’s picture

#9 Response

>Surely a text area is not necessary?

Actually it is. Text Fields have a very short max capacity, far shorter than URL's can be.

The only choice was to go to a Text Area.

Sorry tinyMCE grabs it. I do not use that module, so no idea how it would be possible to code tinyMCE not to take over that control. If you have ideas, I suggest you open a new ticket and make a suggestion / code contribution.

Thanks! :-)

nancydru’s picture

@yelloroadie: actually there is an easy way to tell TinyMCE not to do weblinks; it just can't be put into a module. Disable TinyMCE for dynamically named textareas

nancydru’s picture

Status: Active » Fixed
nancydru’s picture

Status: Fixed » Closed (fixed)