Hi.
I am very worried about upgrading my site to 4.7, and the (complete?) drop of the "base" element in this version. I agree that "base" is not perfect, and I am suffering 404 errors in my logs, so a fix is welcome. I copied the site installation to my local machine, and but I still have two problems:
1. Most URLs are broken.
It seems the update.php has some rules to change URLs written by users in nodes and comments, but here it didn't worked. The script forgets to change URLs written like this:
<a href="./foo/bar">something</a>
So here, all my links in the content are broken. I think I can do something passing sed to a database dump, but still is a horrible pain.
2. The site is a lot less flexible.
Say I have my drupal installation in example.net/, and before I do a real upgrade, or while I'm testing a theme, I copy it to my local machine, and I do the changes there. The site is now in localhost/drupal. It worked just fine in 4.6 or previous, but if URLs now are always absolute, a setup like this will not work anymore. Or I am missing something?
I am very surprised by this, because there is no explanation in UPGRADING.txt, nor in the update.php text, nor in the 4.7.0 announcement, and in the new settings.php is written that $base_url the variable is optional, but I have it uncommented, and I don't see any changes. :-(
Any suggestions are welcome. Thanks.
Alejandro Exojo wrote:
Hi.
I am very worried about upgrading my site to 4.7, and the (complete?) drop of the "base" element in this version. I agree that "base" is not perfect, and I am suffering 404 errors in my logs, so a fix is welcome. I copied the site installation to my local machine, and but I still have two problems:
- Most URLs are broken.
It seems the update.php has some rules to change URLs written by users in nodes and comments, but here it didn't worked. The script forgets to change URLs written like this:
<a href="./foo/bar">something</a>
So here, all my links in the content are broken. I think I can do something passing sed to a database dump, but still is a horrible pain.
- The site is a lot less flexible.
Say I have my drupal installation in example.net/, and before I do a real upgrade, or while I'm testing a theme, I copy it to my local machine, and I do the changes there. The site is now in localhost/drupal. It worked just fine in 4.6 or previous, but if URLs now are always absolute, a setup like this will not work anymore. Or I am missing something?
I am very surprised by this, because there is no explanation in UPGRADING.txt, nor in the update.php text, nor in the 4.7.0 announcement, and in the new settings.php is written that $base_url the variable is optional, but I have it uncommented, and I don't see any changes. :-(
I've been thinking that what we really need is a simple filter that would properly do urls. It could look, for example, like:
[url=node/123]
It'd be filtered into:
http://www.example.com/directory/node/123
(I pick absolute because content can end up in an RSS feed and RSS feeds work better with absolute URLs)
The code to write the filter ought not be all that difficult.
El Lunes, 26 de Junio de 2006 02:28, Earl Miles escribió:
I've been thinking that what we really need is a simple filter that would properly do urls. It could look, for example, like:
[url=node/123]
What do you think this syntax brings that HTML doesn't have? I don't see your point.
It'd be filtered into:
But why URLs should be converted to absolute? I know exactly where the content will be posted, and where the target I'm linking to is located, and they are at the same site, so I can post relative links, and if I need to move the site, links still work.
(I pick absolute because content can end up in an RSS feed and RSS feeds work better with absolute URLs)
No if you add the xml:base attribute.
(I pick absolute because content can end up in an RSS feed and RSS feeds work better with absolute URLs)
No if you add the xml:base attribute.
I recently discovered the same issue with RSS feeds in Drupal. If I don't use absolute links for images for instance, the images will not show up in the feeds. I would rather use relative links. If xml:base is the solution, then this is a fix that should be added to the core Drupal code which handles RSS for <front> and taxonomy.
How do others deal with this right now? Do you use absolute links for images throughout your site or use relative and know that the image will be broken in RSS parsers?
Thanks, Mark
No if you add the xml:base attribute.
I recently discovered the same issue with RSS feeds in Drupal. If I don't use absolute links for images for instance, the images will not show up in the feeds. I would rather use relative links. If xml:base is the solution, then this is a fix that should be added to the core Drupal code which handles RSS for <front> and taxonomy.
Psst, guess what? xml:base is *already* in Drupal's RSS feed. Very few feed readers support it because feed readers think only about RSS and Atom, and much less about XML or namespaces or hell, even doctypes.
Thanks for letting me know Morbus. I didn't check first.
This still leaves the question. Which method are folks using.. absolute or relative? Love to hear from a few Drupalers especially if they have made a decision based on this issue like I have. I have been doing absolute, now, but am thinking about going to relative and just not worrying about the images breaking.
Thanks, Mark
On Jun 26, 2006, at 9:20 AM, Morbus Iff wrote:
No if you add the xml:base attribute.
I recently discovered the same issue with RSS feeds in Drupal. If I don't use absolute links for images for instance, the images will not show up in the feeds. I would rather use relative links. If xml:base is the solution, then this is a fix that should be added to the core Drupal code which handles RSS for <front> and taxonomy.
Psst, guess what? xml:base is *already* in Drupal's RSS feed. Very few feed readers support it because feed readers think only about RSS and Atom, and much less about XML or namespaces or hell, even doctypes.
-- Morbus Iff ( sleep breeds sanity ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus -- [ Drupal support list | http://lists.drupal.org/ ]
This still leaves the question. Which method are folks using.. absolute or relative? Love to hear from a few Drupalers especially if they have made a decision based on this issue like I have. I have been doing absolute, now, but am thinking about going to relative and just not worrying about the images breaking.
Generally speaking, nowadays, I always use absolute for non-design elements. I can not, nor wish to, control where my content shows up, and that means I should be as amicable as possible to making it show up correctly.
Thanks Morbus. That is a good way to look at it. I will continue with absolute for now.
On Jun 26, 2006, at 9:36 AM, Morbus Iff wrote:
This still leaves the question. Which method are folks using.. absolute or relative? Love to hear from a few Drupalers especially if they have made a decision based on this issue like I have. I have been doing absolute, now, but am thinking about going to relative and just not worrying about the images breaking.
Generally speaking, nowadays, I always use absolute for non-design elements. I can not, nor wish to, control where my content shows up, and that means I should be as amicable as possible to making it show up correctly.
-- Morbus Iff ( hey britney, you say you want to lose control? ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus -- [ Drupal support list | http://lists.drupal.org/ ]
No if you add the xml:base attribute.
LOL, no. Very few readers support RSS correctly, must less optional features of XML.
Alejandro Exojo wrote:
El Lunes, 26 de Junio de 2006 02:28, Earl Miles escribió:
I've been thinking that what we really need is a simple filter that would properly do urls. It could look, for example, like:
[url=node/123]
What do you think this syntax brings that HTML doesn't have? I don't see your point.
What it brings is that with HTML you have to know the relative path in Drupal 4.7; while you don't need to know the site, if your site is at:
http://www.example.com/foo/bar
Just using href='node/25' won't work. You need to use href='/foo/bar/node/25' which can complicate multi-site quite a bit.
It'd be filtered into:
But why URLs should be converted to absolute? I know exactly where the content will be posted, and where the target I'm linking to is located, and they are at the same site, so I can post relative links, and if I need to move the site, links still work.
(I pick absolute because content can end up in an RSS feed and RSS feeds work better with absolute URLs)
No if you add the xml:base attribute.
If only more than a handful of readers actually supported this. Enough don't that Drupal's RSS feeds can be a bit problematic.
El Lunes, 26 de Junio de 2006 16:43, Earl Miles escribió:
I've been thinking that what we really need is a simple filter that would properly do urls. It could look, for example, like:
[url=node/123]
What do you think this syntax brings that HTML doesn't have? I don't see your point.
What it brings is that with HTML you have to know the relative path in Drupal 4.7; while you don't need to know the site, if your site is at:
http://www.example.com/foo/bar
Just using href='node/25' won't work. You need to use href='/foo/bar/node/25' which can complicate multi-site quite a bit.
But your syntax is not HTML, so web browsers don't understand it, so it needs to be converted, _and_ the path needs to be modified prepending "/foo/bar/" to it. With just HTML, only the URL needs to be modified.
Alejandro Exojo wrote:
But your syntax is not HTML, so web browsers don't understand it, so it needs to be converted, _and_ the path needs to be modified prepending "/foo/bar/" to it. With just HTML, only the URL needs to be modified.
Well, yes, I'm proposing a filter. Filters by their nature have to be converted to HTML on output. Drupal does a fair bit of filtering and can do a lot more. I don't really understand the problem you have with this proposed solution; just using HTML doesn't solve...well, anything, since the base tag is no longer used the way it was in 4.6.
On 6/26/06, Earl Miles merlin@logrus.com wrote:
Alejandro Exojo wrote:
But your syntax is not HTML, so web browsers don't understand it, so it needs to be converted, _and_ the path needs to be modified prepending "/foo/bar/" to it. With just HTML, only the URL needs to be modified.
Well, yes, I'm proposing a filter. Filters by their nature have to be converted to HTML on output. Drupal does a fair bit of filtering and can do a lot more. I don't really understand the problem you have with this proposed solution; just using HTML doesn't solve...well, anything, since the base tag is no longer used the way it was in 4.6.
I have done something similar with a modified version of URLFilter. The first thing it does is clean up all a href tags to make them absolute regardless of what the user entered. It then goes on and does other things I´m not so proud of, but that the client demanded (inserted a target="_blank"). You could tweak that idea further to have it also filter all img tags to include the absolute URL (as folks in this thread have pointed out can be helpful for RSS syndication).
I´d be happy to clean up that modified version and share it (in about three weeks, I´m currently on vacation...). It´s relatively simple to do though, using the format of URLFilter as a basis for the work.
Regards, Greg
Greg,
That would be great. Thanks for sharing!
Mark
On Jun 26, 2006, at 3:18 PM, Greg Knaddison - GVS wrote:
On 6/26/06, Earl Miles merlin@logrus.com wrote:
Alejandro Exojo wrote:
But your syntax is not HTML, so web browsers don't understand
it, so
it needs to be converted, _and_ the path needs to be modified prepending
"/foo/bar/"
to it. With just HTML, only the URL needs to be modified.
Well, yes, I'm proposing a filter. Filters by their nature have to be converted to HTML on output. Drupal does a fair bit of filtering and can do a lot more. I don't really understand the problem you have with this proposed solution; just using HTML doesn't solve...well, anything, since the base tag is no longer used the way it was in 4.6.
I have done something similar with a modified version of URLFilter. The first thing it does is clean up all a href tags to make them absolute regardless of what the user entered. It then goes on and does other things I´m not so proud of, but that the client demanded (inserted a target="_blank"). You could tweak that idea further to have it also filter all img tags to include the absolute URL (as folks in this thread have pointed out can be helpful for RSS syndication).
I´d be happy to clean up that modified version and share it (in about three weeks, I´m currently on vacation...). It´s relatively simple to do though, using the format of URLFilter as a basis for the work.
Regards, Greg
-- Greg Knaddison | Growing Venture Solutions Denver, CO | http://growingventuresolutions.com Technology Solutions for Communities, Individuals, and Small Businesses -- [ Drupal support list | http://lists.drupal.org/ ]