SEF generates different urls

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
User avatar
aliens
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Fri Sep 28, 2007 4:30 pm

Re: SEF generates different urls

Post by aliens » Mon Dec 17, 2007 7:04 pm

AmyStephen wrote: These are my terms - and this is what I mean when I use them:

System-generated duplicate content occurs when Joomla! uses more than one URL for the same webpage. There is nothing the user can do to fix these problems. Joomla! v 1.0.x has lots of these issues. Modules, the v 1.0.12 frontpage read more links, the search, etc.
- Joomla! v 1.5 with SEF URLs on does not create System-generated duplicate content.  8)

User-generated duplicate content occurs when the USER creates more than one web page (with a menu item) to the same article or component. If the user wants more than one menu item to the same article or component, the correct way to do so, without creating duplicate content, is to use an External Link menu type and the existing URL.

- It is a learning issue. User-generated duplicate content can be created or avoided by the user.

Hope that helps!
Amy :)
Uhm no, not really. Joomla! 1.5, before this fix, did create multiple URL's for the same webpage.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: SEF generates different urls

Post by AmyStephen » Mon Dec 17, 2007 7:13 pm

AmyStephen wrote: SVN 9611
It's fixed! Thanks Louis Landry!  :-*

There goes the last of Joomla! v 1.5 System Generated Duplicate Content. From this point forward, it's up to us!

Amy :)
Aliens - wasn't that what I was saying? Let's quit wasting time.

User avatar
dan1dyoung
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 140
Joined: Fri Dec 09, 2005 6:18 pm
Location: England
Contact:

Re: SEF generates different urls

Post by dan1dyoung » Wed Dec 19, 2007 5:59 pm

Hi Amy,

I used the Route as you said and got the friendly URL with SEF on (Thank you), a couple of things:

1) With the SEF on i get /joomla/index.php/submit-an-article.html for /joomla/index.php?option=com_content&view=article&layout=form&Itemid=51, but when i turn it off again i get /joomla/index.php?option=com_content&view=article&id=&Itemid=51 for /joomla/index.php?option=com_content&view=article&layout=form&Itemid=51 (The printout is with & in place of the &whatever=, parts missing, e.t.c)

2) I am also looking to add the http://localhost bit (Or http://www.mydomain.com) in front of the JRoute to create a link and to show which site the content is on, like we used to have with $mosconfig_live_site but i have tried $this->baseurl but it returns nothing??

3) I am currently triggering this onAfterRoute which does most of what i want but would like to make the link point to the newly created article not the submit article form, as i have read on here there is no onAfterSave or something that is applied after the save so i can get the correct link (Can currently get the frontpage, the cat id, the section id, & the title, but not the article id, the alias, state, or cid), is that correct or can i do something to solve this??

Current code (Have not checked all names are correct Like the users, groups, e.t.c) and have only really concentrated on the author create then when it is correct i will add the other users and all the different tasks per group.  There are also repeats of code as i am still testing to see which gives me the result i want (Will tidy up when all is OK!!!)

Code: Select all

function onAfterRoute()
	{
		global $mainframe;

		$lang   =& JFactory::getLanguage();
		$lang->load( 'plg_system_dynotifyall' , JPATH_ADMINISTRATOR );

		$user =& JFactory::getUser();
		$isAuthor = ($user->usertype == 'Author');
		$isEditor = ($user->usertype == 'Editor');
		$isManager = ($user->usertype == 'Manager');
		$isAdministrator = ($user->usertype == 'Administrator');
		$isSuperAdministrator = ($user->usertype == 'SuperAdministrator');

		$isEditing = (JRequest::getCmd( 'task' ) == 'save') && (JRequest::getCmd( 'option' ) == 'com_content');
		$isDeleting = (JRequest::getCmd( 'task' ) == 'delete') && (JRequest::getCmd( 'option' ) == 'com_content');

		$isNew = ((int) $post['id'] < 1);

		$domain = JURI::current();
		$domain2 = $this->baseurl;
		$sitename = $mainframe->getCfg('sitename');
		$URI =& JFactory::getURI();


// Author - Created Article
		if ($isAuthor && $isEditing) {

			If ($isNew) {

			$msg = JText::_( 'domain' ) . ' ' . $domain . "\n";
			$msg .= JText::_( 'site name' ) . ' ' . $sitename . "\n";
			$msg .= $user->name . ' (' . $user->email .') ' . JText::_( 'has created article' ) . ' "' . JRequest::getVar( 'title' ) . "\"\n";
			$msg .= JText::_( 'link' ) . ' ' . $URI->current() . '?view=article&catid=' . JRequest::getInt( 'catid' ) . '&id=' . JRequest::getInt( 'id' ) . '&Itemid=' . JRequest::getInt( 'Itemid' ) . '&option=com_content' . "\n";
			$msg .= JRoute::_( ContentHelperRoute::getArticleRoute( $articleid ) ) . "\n";
			$msg .= 'http://www.' . $this->baseurl . "\n";
			$msg .= $domain2 . "\n";
			$msg .= JRequest::getVar( 'title' ) . "\n";
			$msg .= JRequest::getVar( 'alias' ) . "\n";
			$msg .= JRequest::getVar( 'frontpage' ) . "\n";
			$msg .= JRequest::getVar( 'sectionid' ) . "\n";
			$msg .= JRequest::getVar( 'catid' ) . "\n";
			$msg .= JRequest::getVar( 'state' ) . "\n";
			$msg .= JRequest::getVar( 'articleid' ) . "\n";
			$msg .= JRequest::getVar( 'cid' ) . "\n";

			$mail =& JFactory::getMailer();
			$mail->setSubject( $this->params->get( 'subject1') . ' ' . $user->name . ' ' . JText::_( 'has created article' ) . ' "' . JRequest::getVar( 'title') . '"');
			$mail->setBody($msg);
			$mail->addRecipient( $this->params->get( 'recipient1'));
			$mail->Send();
			}
		else
		{

// Author - Edited Article

			$lang   =& JFactory::getLanguage();
			$lang->load( 'plg_system_dynotifyall' , JPATH_ADMINISTRATOR );

			$msg = $user->name . ' <' . $user->email .'> ' . JText::_( 'has edited article' ) . ' "' . JRequest::getVar( 'title' ) . "\"\n";
			$URI =& JFactory::getURI();
			$msg .= 'URL: ' . $URI->current() . '?view=article&catid=' . JRequest::getInt( 'catid' ) . '&id=' . JRequest::getInt( 'id' ) . '&Itemid=' . JRequest::getInt( 'Itemid' ) . '&option=com_content' . "\n";

			$mail =& JFactory::getMailer();
			$mail->setSubject( '[' . $this->params->get( 'subject2' , JText::_( 'ARTICLE EDITED' ) ) . '] ' . JRequest::getVar( 'title' ) );
			$mail->setBody($msg);
			$mail->addRecipient( $this->params->get( 'recipient2' , $mail->From ) );
			$mail->Send();

		}
		}
Thanks

Dan

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: SEF generates different urls

Post by AmyStephen » Thu Dec 20, 2007 12:10 am

Dan -

You might want to take a look at depresz's Twitter extension. He is an exceptional GHOP contestant.

His plugin sends the title of a Joomla! article and its tiny url to Twitter.He determines the URL of an article that just posted (including the domain name) in order to send that (via CURL) to tiny url, before posting to Twitter. I think you will find answers to your questions in that code.

The BaseURL only contains subdirectory information. If you installed your website in http://Example.com/Joomla - it would contain Joomla!.

Hope that helps!
Amy :)

User avatar
dan1dyoung
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 140
Joined: Fri Dec 09, 2005 6:18 pm
Location: England
Contact:

Re: SEF generates different urls

Post by dan1dyoung » Thu Dec 20, 2007 2:18 am

Hi Amy,

Just took a look at twitter (Did look the other day but must of missed what i wanted!!!).

It now does what i want but i have the following error trying to access the admin side (So have not checked it with SEF back on again):

Fatal error: Class 'JSite' not found in C:\Program Files\xampp\htdocs\joomla\components\com_content\helpers\route.php on line 99

The only change is the reference to that file as used in twitter
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');

I also changed the address slightly as if you left the sub part empty you get double // like http://localhost//joomla/index.php?option=com_content&view=article&id=85

Used:

Code: Select all

//Create full path of article
		if ($SUB_DIR==""){
		$address="http://".$SERVER.$SUB_DIR.$path;}
		else{
		$address="http://".$SERVER.$SUB_DIR."/".$path;
		}
Thanks

Dan

User avatar
dan1dyoung
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 140
Joined: Fri Dec 09, 2005 6:18 pm
Location: England
Contact:

Re: SEF generates different urls

Post by dan1dyoung » Thu Dec 20, 2007 6:57 pm

Hi Amy,

Don't worry, i see other had the same error on RC3 so i have just downloaded the nightly and now it is fine.

One thing i have noticed in the core (Do not know the best place to report it) is that the SMTP mail password is not masked in the "Help/System info/Configuration file" like the database and admin passwords are (I would of expected all passwords to be masked/encrypted when read by anything other than the program)??


Also where do you get the build number (I see 4 digit numbers used) but all i can see is "Joomla! 1.5.0 Production/Stable [ Karibu ] 19-December-2007 19:00 GMT "

Thanks

Dan

User avatar
kenmcd
Joomla! Champion
Joomla! Champion
Posts: 5672
Joined: Thu Aug 18, 2005 2:09 am
Location: California
Contact:

Re: SEF generates different urls

Post by kenmcd » Thu Dec 20, 2007 7:20 pm

dan1dyoung wrote: Also where do you get the build number (I see 4 digit numbers used) but all i can see is "Joomla! 1.5.0 Production/Stable [ Karibu ] 19-December-2007 19:00 GMT "

Take a look inside the CHANGELOG.php file (in Joomla site root directory).
Line 3 will read something like this:
* @version $Id: CHANGELOG.php 9692 2007-12-20 16:04:31Z tsai146 $

9692 is the build number.

(Note: this is a version which I downloaded from the SVN today, yours may be different)
██ LibreTraining

User avatar
dan1dyoung
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 140
Joined: Fri Dec 09, 2005 6:18 pm
Location: England
Contact:

Re: SEF generates different urls

Post by dan1dyoung » Thu Dec 20, 2007 8:52 pm

kenmcd wrote:
dan1dyoung wrote: Also where do you get the build number (I see 4 digit numbers used) but all i can see is "Joomla! 1.5.0 Production/Stable [ Karibu ] 19-December-2007 19:00 GMT "

Take a look inside the CHANGELOG.php file (in Joomla site root directory).
Line 3 will read something like this:
* @version $Id: CHANGELOG.php 9692 2007-12-20 16:04:31Z tsai146 $

9692 is the build number.



(Note: this is a version which I downloaded from the SVN today, yours may be different)



Thanks Kenmcd, yep mine was 9682 (They have been busy today!!!)

Thanks

Dan

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Freedom gives no excuse not to have explicitly documented architecture

Post by yvolk » Sun Dec 23, 2007 9:32 am

AmyStephen wrote:
Hi, try to get used to the fact, that the only authoritative answer to the question "how" lies in the code 
Yuri -

1. The Joomla! community has available that which members of the Joomla! community freely make available. If there is something else we desire, someone must voluntarily make that available. Eric Raymond calls that a scratch your own itch motivation and in sum, that is what drives output from an open source community.
Thank you, Amy for pointing me to such an interesting reading ("The Cathedral and the Bazaar" by Eric Steven Raymond). I've read it wholly... though last sections seem quite hard to read...
AmyStephen wrote:
2. Yes, we can look at the source code to find answers. Yes, we can figure out how things work by experimenting. In fact, that's kind of the point!

Freedom 1:
The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this.
This type of software development process is not for everyone. Those who participate with Joomla! are free to choose to do those things they find interesting. No one is obligated to one another. We are a cooperative entity, moved forward by the dedication of volunteers who tend to perform better when they are encouraged.
Yet, freedom gives no excuse not to have explicitly documented architecture... I've just searched the Internet for this subject - and here is what BREDEMEYER CONSULTING thinks of documenting architecture (setting in bold is mine):
Document Assumptions, Assertions, Decisions, Issues and Ideas. A slew of architecture decisions
are reflected in the conceptual architecture diagram and models of architectural mechanisms. These decisions
are grounded in assumptions, experience, tradeoffs, and so on. Unless we document the reasoning
behind, and rationale for, the decisions while it is all fresh in memory, we will become overcome by pressures
of downstream tasks and the rationale will be lost. To put it bluntly, too often the only thing harder
than getting the architects to write down their designs, decisions and rationale is getting the intended audience
to read it! But that is no excuse. We have to create a record, for an undocumented architecture does
not exist.
You will not be able to communicate it, you will forget important details, and you will not be able
to expand your capacity at critical points since you will have no mechanism for others to come up to speed
on the architecture without getting direct access to your head!
Text of all my messages is available under the terms of the GNU Free Documentation License: http://www.gnu.org/copyleft/fdl.html

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: SEF generates different urls

Post by AmyStephen » Sun Dec 23, 2007 4:40 pm

Yuri -

Your complaints about the volunteer efforts of others not meeting your standards are getting very boring. Do something about it! Don't do something about it! You are free. We are each free.

Amy

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: Complaints about the volunteer efforts of others not meeting your standards

Post by yvolk » Sun Dec 23, 2007 5:46 pm

AmyStephen wrote: Yuri -

Your complaints about the volunteer efforts of others not meeting your standards are getting very boring. Do something about it! Don't do something about it! You are free. We are each free.

Amy
Sorry, Amy. My 'complaints' are in fact not to You personally, not to other 'volunteers', but to the management of the Joomla! project... Thank you for you at least found time to answer me.
Next time I'll try to address my 'methodological' questions to someone from Joomla! Core Team... or the board of the "Open Source Matters (OSM)"...
Text of all my messages is available under the terms of the GNU Free Documentation License: http://www.gnu.org/copyleft/fdl.html

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: Complaints about the volunteer efforts of others not meeting your standards

Post by AmyStephen » Sun Dec 23, 2007 5:54 pm

yvolk wrote:
AmyStephen wrote: Yuri -

Your complaints about the volunteer efforts of others not meeting your standards are getting very boring. Do something about it! Don't do something about it! You are free. We are each free.

Amy
Sorry, Amy. My 'complaints' are in fact not to You personally, not to other 'volunteers', but to the management of the Joomla! project... Thank you for you at least found time to answer me.
Next time I'll try to address my 'methodological' questions to someone from Joomla! Core Team... or the board of the "Open Source Matters (OSM)"...
They are also volunteers, Yuri.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19070
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: SEF generates different urls

Post by infograf768 » Sun Dec 23, 2007 6:05 pm

Please keep OT....
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
yvolk
Joomla! Guru
Joomla! Guru
Posts: 979
Joined: Thu Jun 01, 2006 1:52 pm
Location: Moscow, Russia
Contact:

Re: SEF generates different urls

Post by yvolk » Sun Dec 23, 2007 6:27 pm

infograf768 wrote: Please keep OT....
Hi, infograf768! Please give me your advice: where is the right place to discuss Joomla! development methodologies, management, etc.?
AmyStephen wrote:
yvolk wrote: Next time I'll try to address my 'methodological' questions to someone from Joomla! Core Team... or the board of the "Open Source Matters (OSM)"...
They are also volunteers, Yuri.
At least these people can't do 'whatever they want': they have (at least in their heads) some 'agreements' (we may call them 'standards' or 'methodologies'), that are shared between members, and follow them... I don't think these 'agreements' are taboo  :).
Text of all my messages is available under the terms of the GNU Free Documentation License: http://www.gnu.org/copyleft/fdl.html

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19070
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: SEF generates different urls

Post by infograf768 » Mon Dec 24, 2007 6:49 am

@Yvolk,
I would use this forum: http://forum.joomla.org/index.php/board,326.0.html
or http://forum.joomla.org/index.php/board,60.0.html

Now, keeping OT means the topic at stake (SEF) should not be hijacked by a personal discussion on standards IMO.
Better start a new thread.

@Amy
Volunteers or not, constructive criticism/suggestion is always welcome.
1.5 has been and is still a WIP on some aspects. Specifically the SEF part.
We all hope that, when stable, more extensive documentation will be produced.
Last edited by infograf768 on Mon Dec 24, 2007 6:55 am, edited 1 time in total.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: SEF generates different urls

Post by AmyStephen » Mon Dec 24, 2007 3:20 pm

Agreed. In fact, over a month ago, I suggested the specific problem identified in this thread be looked at by posting in the Q&T forum area. I linked to three other General Forum threads where the issue was also recognized. I have spent a great deal of time tracking SEF URL issues and working to resolve these problems. It is good to raise these issues so that the problems can be fixed.

User avatar
holdencreative
Joomla! Explorer
Joomla! Explorer
Posts: 469
Joined: Thu Oct 13, 2005 1:51 am
Location: Hamilton, ON
Contact:

Re: SEF generates different urls

Post by holdencreative » Wed Apr 30, 2008 6:35 am

Hi Amy, Jean-Marie, et al.

I started using Mambo in 2004-5, as a total newbie to web design. Since then, I'm happy to say that I've taught myself a few types of code and worked extensively on mambo / joomla websites.

Tonight, I noticed the url issue described in this topic - and visited the forum - already guessing that you were working on it.
This type of software development process is not for everyone. Those who participate with Joomla! are free to choose to do those things they find interesting. No one is obligated to one another. We are a cooperative entity, moved forward by the dedication of volunteers who tend to perform better when they are encouraged.
I'm writing to say thanks. This sort of initiative is why I've been more active with helping out new Joomla users on the forums lately. I know that I and the rest of the community (including many of my not-for-profit clients) appreciate the hard work you all have put into this project.

Best,
AJH

ps. - I know it's off-topic, so I won't be offended if you delete this post.
Joomla! is an all-volunteer project. Be Kind.

Did you know that you can make almost any Joomla! site into an app? http://weeverapps.com

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: SEF generates different urls

Post by AmyStephen » Wed Apr 30, 2008 12:34 pm

AJH -

Are you finding duplicate URLs? This thread preceded v 1.5's initial release and Louis Landry corrected the problems we found earlier.

I know of one issue that has been reported on the Tracker - when the title of an article is linked - on the page of the article - the URL is wrong for the title link. Other than that, I do not know of any system generated duplicate URLs.

If you are seeing one with the latest release, please share the details.

Thanks for supporting the community,
Amy :)

User avatar
dan1dyoung
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 140
Joined: Fri Dec 09, 2005 6:18 pm
Location: England
Contact:

Re: SEF generates different urls

Post by dan1dyoung » Wed Apr 30, 2008 7:34 pm

Hi Amy,

I know you are good with SEF and JRoute so hoping you can solve this for me so i can finish off 2 of my extensions (Finally!!), and then time allowed do some others:

One problem is with contacts and SEF, see here http://forum.joomla.org/viewtopic.php?f=428&t=278866

The other is on content that is uncategorized and SEF, see here http://forum.joomla.org/viewtopic.php?f=428&t=278877

I have tried on 1.5.0, 1.5.1, 1.5.2 and 1.5.3 before it was final release and all give the same. I have done a workaround on the first one (DYContacts) to allow it to be used until the correct SEF error is solved.

The extensions are on my site and JED, my site is http://www.dysolutions.co.uk/joomla

Thanks

Dan


Locked

Return to “Joomla! 1.5 Coding”