Drupal weblink rescue effort

Been pretty busy. I've been doing some freelance user experience work for Traction Software for the past month, so blogging here has been light. I was able to finally upgrade to Drupal 4.7, though, and the transition has been pretty smooth, with the exception of my weblinks.

As you may know, the weblink.module seems to be rather deceased or at least not upgraded to 4.7. I spent a little time thinking about how I can rescue my 813 weblink records which now only contain the bodies, but no longer link to the URL associated with the entry. So I was thinking I could use MySQL UPDATE and concatenate the node_revisions.body and weblink.weblink fields. Then I could change all weblink types to blog types.

I tried this MySQL statement:

UPDATE `node_revisions`, `weblink`
SET `node_revisions`.`body`=concat(`node_revisions`.`body`,"<br /><a href=\"",`weblink`.`weblink`,"\">Visit this page</a>")
WHERE `node_revisions`.`nid` = `weblink`.`nid`;

MySQL returns this feedback:

Query OK, 813 rows affected (0.15 sec)
Rows matched: 813 Changed: 813 Warnings: 0

So all seems OK, but when I check any weblink records, node_revisions.body hasn't been modified. I then realize that the field is a LONGTEXT and wonder if that's why nothing is happening. Can anyone provide some insight into how to get the above to work? You know that I'm an interface design and user experience guy, not a developer, so my MySQL chops are pretty light.

Any Drupal heroes out there? I created an entry for this problem on the Drupal forum, so if someone offers a response here, I'll be sure to update the entry in the forum.

Comments

01 Peterv
06/28/06 @ 09:08

Mmmm, not sure. You should be able to update a LONGTEXT field..

02 jibbajabba
06/28/06 @ 09:09

The UPDATE should work, but I think it's the CONCAT that's failing.

Advertisement
03 jibbajabba
06/28/06 @ 14:32

Sigh. The links module isn't working out for me for some reason. The experience is chronicled on the forum.

04 Doug
06/29/06 @ 08:47

That's one of the things I don't like about Drupal, plugins and things in general tend to break with every upgrade, its developers change ideas every week about what direction it should take and if you're not a developer and can fix things by yourself, well you're screwed.

05 jibbajabba
06/29/06 @ 10:21

I haven't been paying close attention to the core revisions to know why backward compatability is not possible with older modules. I presume that it has something to do with improvement and rewriting of the core code that deprecates methods or functions used by modules in previous releases.

I also assume that with a new major revision, that this won't be an issue with each dot release. But I'm willing to accept the breakage with upgrades. Even though I'm a designer rather than a developer, I'm rarely phased by the lack of synch of the modules I install. There is always another contributed module that does something similar to what I want. One example on this site is the hierarchical category browsing module I use. I now use sitemap in favor of sitemenu because sitemenu and pathauto were doing wierd things.

06 jibbajabba
06/29/06 @ 10:58

Posted this question on MySQL forums as well, but no replies so far. bomarmonk has been really helpful on the Drupal forums and suggested that I try re-installing links module. Will try that again.

07 Doug
06/29/06 @ 13:46

I was using Drupal for a couple of months, having Flexinode create most of my type fields, then with the arriving of 4.7 it stopped working because the developers decided to adopt CCK for this purpose. After a couple of days trying to fix it, I just quit, I'm not a programmer and didn't want to stay with an older version of a CMS. I have the feeling most Drupal users don't care about these things because they're developers and can easily fix this sort of problems, but for less skilled people like me I think Drupal is not mature enough.

Your site looks incredible, though and your problem is not a catastrophic one.

Cheers.

08 2bits
07/03/06 @ 17:01

I posted a PHP snippet that does what you want in the forum topic here http://drupal.org/node/71128

It worked for a client who had some weblinks and did not want to move to links, but preserve the pages and the links.

-- Khalid

09 jibbajabba
07/03/06 @ 18:43

Thanks, Khalid. I hadn't thought of running the query that way. Ran this and it indicated that the 813 records were processed, but once again, the records actually remain unchanged. Very strange. Should have worked in the first place from the MySQL command line.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <b> <strong> <dd> <dl> <dt> <i> <li> <ol> <u> <ul> <code> <blockquote> <fieldset> <legend> <h6> <span> <img> <div> <p>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options