[KNOWN ISSUE] Wrong itemid on frontpage

jjohnsen
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Feb 02, 2006 2:50 pm

[KNOWN ISSUE] Wrong itemid on frontpage

Post by jjohnsen » Thu Feb 02, 2006 3:14 pm

Using Joomla 1.0.7

All links on frontpage have wrong itemid, titles and read more links, they all come up with the same itemid, and that is 1 (one).

Anyone got the same trouble.
Last edited by stingrey on Tue Feb 14, 2006 11:34 am, edited 1 time in total.

Hitmaker.ca
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jan 04, 2006 8:52 pm
Location: Nova Scotia
Contact:

Re: Wrong itemid on frontpage

Post by Hitmaker.ca » Sun Feb 05, 2006 9:27 pm

Yes I have the same problem when using news flash.. I thought updating from 1.0.5 to .7 was going to solve this but it hasn't and its driving me crazy :(
Please help!

Hitmaker.ca
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jan 04, 2006 8:52 pm
Location: Nova Scotia
Contact:

Re: Wrong itemid on frontpage

Post by Hitmaker.ca » Sun Feb 05, 2006 9:37 pm

One more thing to add that I find quite bizarre... I have two Newsflash modules on my front page and when I first load up the page, one of the modules linked titles actually works correctly. However the other Newsflash module links the itemid=1.. and after I click on it the other module that worked on first load now uses the itemid=1.. woah..

Hitmaker.ca
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jan 04, 2006 8:52 pm
Location: Nova Scotia
Contact:

Re: Wrong itemid on frontpage

Post by Hitmaker.ca » Sun Feb 05, 2006 10:05 pm

Found a way to fix my problem but 'why' is still a mystery to me.
I made sure that any newsflash modules' content had a published menu item and now the itemid=1 is gone. I didn't want those particular items to have their own menu item so I published them to a menu that I don't actually use and it still works out fine.
YAY!
I <3 Joomla.

magnet0
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Jan 25, 2006 7:08 am
Location: Crete, Greece

Re: Wrong itemid on frontpage

Post by magnet0 » Tue Feb 07, 2006 8:49 am

Have anyone solve this problem ?
I am having the same problem !!!

Any thoughts or help ??

User avatar
Loewenherz
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Fri Sep 09, 2005 10:16 am
Contact:

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by Loewenherz » Sat Mar 18, 2006 4:29 pm

I have only the problem (since 1.07), that - if I activate "Category Name Linkable" - the wrong categories are linked. But I see, this issue is here.
Last edited by Loewenherz on Sat Mar 18, 2006 4:31 pm, edited 1 time in total.
phpBB.de-Team - Open Directory Project - Joomla-Blog

dacosta
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri Dec 16, 2005 11:01 am

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by dacosta » Tue May 02, 2006 9:56 am

I've got the same issue. But all my categories are published in a menu and still the frontpage gives the itemid=1. This is only with the read more functionality. Is there a fix available?

Situation:
option=com_content&task=view&id=153&Itemid=1

Wanted situation:
option=com_content&task=view&id=153&Itemid=51

Regards,
Thijs

lejovchina
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 143
Joined: Thu Aug 25, 2005 8:20 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by lejovchina » Sun Jul 09, 2006 9:37 pm

Let's hope there'll be any.

I have the exact same problem on 1.0.10

Ljv.

rmd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 233
Joined: Sat Feb 18, 2006 3:31 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by rmd » Tue Aug 01, 2006 2:55 pm

I am having the same issue...only not just on the front page. Any blog section or category is giving incorrect itemids on all "read more" links. Any progress on this?

AmyStephen

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by AmyStephen » Tue Aug 01, 2006 9:09 pm

Looks like the same issue here, and in two other places, below, but not yet resolved.

ItemID missing in com_frontpage

AmyStephen

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by AmyStephen » Sat Aug 05, 2006 3:20 pm

Actually, after I look more closely, I do not believe this problem you all are discussing is the same thing. Sorry!

You can look at this proposed FAQ item entitled 1.0.10 upgrade: Read more returns "you are not authorized" error and is located but, I think this is a different issue.

My apologies. Amy
Last edited by AmyStephen on Sat Aug 05, 2006 3:27 pm, edited 1 time in total.

AmyStephen

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by AmyStephen » Sat Aug 05, 2006 3:30 pm

Sorry for spamming this thread, but, I wonder if this is the real answer you are looking for, see Walb's fix:

lejovchina
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 143
Joined: Thu Aug 25, 2005 8:20 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by lejovchina » Sat Aug 05, 2006 3:42 pm

Thank you very much for pointing us out those resources.
They both contain precious info.
Let's hope it works for out of the box. I really would like to skip the "fake menu" step. The portal i have to fix has like 200 menu items :)

Cheers,

Ljv.

AmyStephen

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by AmyStephen » Sat Aug 05, 2006 3:49 pm

Ljv -

I was just going to come and find you. I have been trying to figure these ItemID issues out and saw your comment in the other thread. So, I am glad you found this.

Now, if you have already have menu items defined for each content item with the problem, then check Walb's fix, not the proposed FAQ. (This problem does NOT require the "fake menu" fix.)

But, as of v 1.0.10, all content items must first be associated with a menu item, and that associated ItemID value MUST be included with any links. Previously, some people directly linked to content items without using an ItemID. They are running into problems now on the "read more" or "title" links. For those issues, the Proposed FAQ should be referenced (and fake menu items are required or, better still, using Joomla! as it was intended - the FAQ addresses.)

Please let me know if you get this resolved and how! Good luck!
Amy

lejovchina
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 143
Joined: Thu Aug 25, 2005 8:20 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by lejovchina » Sat Aug 05, 2006 4:58 pm

AmyStephen wrote: Please let me know if you get this resolved and how! Good luck!
Amy
I've got the problem solved completly by adding another line to walb's fix.

It now looks like this. Around like 1496/1499 in includes/joomla.php, replace

Code: Select all

global $Itemid;
		
		$_Itemid = '';
with

Code: Select all

global $Itemid, $option;
		
		$_Itemid = '';
if ($option == 'com_frontpage') {
			$_Itemid = $Itemid;
		}
if ($option == 'com_content') {
			$_Itemid = $Itemid;
		}
As a result, all titles/readmore links are assigned a proper itemid (istead of a persistent one).
This fixes the issue i have had with the breadcrumb.

Again, Amy, thank you so much.


Ljv.

AmyStephen

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by AmyStephen » Sat Aug 05, 2006 5:02 pm

Good work, Ljv. I didn't do anything - just watch and connect threads. But, am glad to help in that little way. Rey and RobInk will have to see what they ultimately think about this. I appreciate you sharing your code back with the community on this. I think that is what it is all about in open source - so, thanks so much for that! We will await official response. Take care! Amy

AmyStephen

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by AmyStephen » Tue Aug 08, 2006 3:04 am

Robin - I am adding Waldorf75's post from another thread here so that this information is consolidated for you. I believe it is a fix IN ADDITION to the fix that Ljv and Walb collaborated on, above, in Reply #14. For v 1.0.11, these fixes should be considered.

Thanks to Walb, Ljv, and Waldorf75 for your bug fixes.

+++

I also got a note from Waldorf75 after he reviewed the FAQ (THANKS!). He reported back the same message as in this post, below, that content items linked to menu items using a "Link - Content Item" option had no ItemID value in the link -- and that the value is missing in the database, as well. (There is not an Itemid=NN in the link for that menu item.) This is what caused him the problem with the read more authorization issue, and he indicates how he resolved it, below.
waldorf75 wrote: Hi folks,

I had a similar problem with one my Joomla sites as initially posted by eyezberg. But on my J the Itemid in the read more links was just missing for all content items that are linked in the menu with an "Link - Content Item". The ItemID of the read more links of other articles were fine.

I just changed a 0 to a 1 the file components/com_content/content.html.php on line 556 (if I didn't add/deleted lines while changing code) in function _Itemid():

Original:

Code: Select all

$row->_Itemid = $mainframe->getItemid( $row->id, 0, 0 );
Changed to:

Code: Select all

$row->_Itemid = $mainframe->getItemid( $row->id, 0, 1 );
It seems as if this triggers the ContentItemLink support in getItemid() of joomla.php

Hope this helps

waldorf

I followed Waldorf's instructions, as per the post above and his email, and tried and tried, but I was unable to reproduce this "authorization" error myself. I absolutely observed the same issues Waldorf is observing -- there is no ItemID value in the URL and there is not a value in the link stored in the database for that menu item, either.

The line of code (below) from my copy of content.html.php on line 556 is just as he indicated. I do not get an ItemID with the menu item (either in the database or the URL), but, I also do not get a not authorized error. If I change it to "1", I do get a ItemID value, but it works just the same either way for me (doesn't fail.)

Waldorf -- did you get an "authorization error" on the "read more" before you changed the "0" to a "1" -- and then no such error after the "1" was in place? (I just want to confirm that with you.)

Code: Select all

if ( $task != 'view' && $task != 'category' ) {
	$row->_Itemid = $mainframe->getItemid( $row->id, 0, 0 );
} else {
// when viewing a content item, it is not necessary to calculate the Itemid
	$row->_Itemid = $Itemid;
}
When this is all fixed, we need to see if the new FAQ item should be removed. It is possible that I do not have it written exactly right -- in particular for Waldorf's case. But, I am not exactly certain how to change it, yet.  ???

These ItemID issues are always very complicated. My respect to Robin and Rey for your mastery of this over the years. Thanks for your continued support of us always, and, again, to the three of you, Walb, Ljv, and Waldorf75, for contributing code to help resolve this problem.

Amy

waldorf75
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Aug 04, 2006 10:29 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by waldorf75 » Tue Aug 08, 2006 5:45 pm

Hi Amy,

yes it was absolutely as you mentioned. Before I changed the code from 0 to 1 I got the unauthorized error when I Clicked the read more link on the Frontpage. But the unauthorized error was only issued when I klicked on an article that is _only_ accessible via a direct "Lin - Content Item" value. If the article is linked via "Blog - category" or "table - Category" in addition then there is no error message issued by J.

Changing the third parameter in

Code: Select all

$mainframe->getItemid( $row->id, 0, 1 );
(com_content.html.php; line 556) from 0 to 1 made if statement within the function getItemid(); in /includes/joomla.php (lines 1495ff) below a true statement

Code: Select all

	function getItemid( $id, $typed=1, $link=1, $bs=1, $bc=1, $gbs=1 ) {
	[...]
		if ($_Itemid == '' && $link && $this->getContentItemLinkCount()) {
			$exists = 0;
			foreach( $this->get( '_ContentItemLink', array() ) as $key => $value ) {
			// check if id has been tested before, if it is pull from class variable store
				if ( $key == $id ) {
					$_Itemid 	= $value;
					$exists 	= 1;
					break;
				}
			}
			// if id hasnt been checked before initaite query
			if ( !$exists ) {				
				// Search for item link
				$query = "SELECT id"
				."\n FROM #__menu"
				."\n WHERE type = 'content_item_link'"
				. "\n AND published = 1"
				. "\n AND link = 'index.php?option=com_content&task=view&id=".$id."'"
				;
				$this->_db->setQuery( $query );
				// pull existing query storage into temp variable
				$ContentItemLink 		= $this->get( '_ContentItemLink', array() );
				// add query result to temp array storage
				$ContentItemLink[$id] 	= $this->_db->loadResult();	
				// save temp array to main array storage
				$this->set( '_ContentItemLink', $ContentItemLink );
				
				$_Itemid = $ContentItemLink[$id];				
			}
		}
	[...]
Unfortunately I'm not that familiar with the Joomla code but it seems as if the lines shown above will determine the correct Itemid from the menu table of the database. If the $link parameter is 0 then the ItemId the lines are simply ignored..

I also tried the fix given by Walb in post http://forum.joomla.org/index.php/topic ... #msg405645 but this doesn't work correctly for me. Indeed it was possible to acccess the article shown on the front page by clicken the readmore link. But with this fix the active Menu is not set to the menu-Item that is used to link to the content item. That's why I preferred to change the 0 the 1.

Could anybody tell me if this is just a bug of Joomla or if my changes may run into other problems?

Thanks a lot
Waldorf

AmyStephen

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by AmyStephen » Fri Aug 11, 2006 7:10 am

PROBLEM: Content Items configured to display on the home page do NOT have pathway.

RESOLVE: Modify includes/joomla.php lines: 1496-1499, replace as follows:

Code: Select all

	function getItemid( $id, $typed=1, $link=1, $bs=1, $bc=1, $gbs=1 ) {
	/**
	* REMOVE
		global $Itemid;
		
		$_Itemid = '';
	*/
	/**
	* ADD BEGIN
	*/
		global $Itemid, $option;
		
		$_Itemid = '';
		if ($option == 'com_frontpage') {
			$_Itemid = $Itemid;
		}
		if ($option == 'com_content') {
			$_Itemid = $Itemid;
		}

	/**
	* ADD END
	*/
Working with another community member who also has this problem yesterday and today. I am able to reproduce this problem easily.

Just create a content item. Place it on the front page. And click the "heading" or the "read more."

There is not breadcrumb trail.

Code changes identified above FIX this problem.

FIXED in v 1.0.11  :)
Last edited by AmyStephen on Tue Aug 29, 2006 8:02 am, edited 1 time in total.

LazyLeopard
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Jul 05, 2006 1:42 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by LazyLeopard » Tue Sep 05, 2006 11:25 pm

I've just installed 1.0.11, and had to re-apply this change in order to re-fix the problem I had previously with 1.0.10.

AmyStephen

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by AmyStephen » Sun Sep 10, 2006 2:02 pm

LazyLeopard -

My apologies, I have not been online for a week, or so.

I believe there is work underway on v 1.0.12. (I don't know for certain but I think so.) I would like to make certain we get good information to the right people so that these fixes get into the core. 12 *might* be the final of the 1.0.x series.

Exactly which problem are you having and change did you have to make? Are there others of you who also are having problems. I would like to see if I can reproduce these, if at all possible.

THANKS!
Amy :)

simonknee
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Wed Aug 16, 2006 3:46 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by simonknee » Thu Sep 14, 2006 10:34 am

I am having this problem and the to joomla.php proposed causes me more issues.

For me if frontpage content that is also in a menu (usually as a sub menu) it is missing the itemID.

Although frontpage links do navigate to the correct content this behaviour spoils both the SEF404 urls (you get a -2 version) and more important the functionality of mod_FWsubmenu, it requires itemID to show the correct submenus .

In testing the proposed changes to joomla.php do add an itemID but it is incorrect, usually set to 1. Moreover the menu links on the frontpage now have different (and incorrect) itemID as compared with all the other pages, again set to 1.

This really breaks the SEF and menu functionality.

Simon

simonknee
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Wed Aug 16, 2006 3:46 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by simonknee » Thu Sep 14, 2006 10:58 am

I think my problem is becuase I do not have blog pages for some of my content and that this is affecting the itemID.

I am setting up un-published blogs for all my content and will report back as I think it might also fix the frontpage behaviour without the code changes...

User avatar
fugazer
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 209
Joined: Sun Mar 12, 2006 5:34 am

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by fugazer » Thu Oct 05, 2006 1:55 am

LazyLeopard wrote: I've just installed 1.0.11, and had to re-apply this change in order to re-fix the problem I had previously with 1.0.10.
I've applied this small patch for my 1.0.11 install.. For me, this code only fixes the pathway from not appearing when clicking "read more"..

When i click "read more" I'm only getting the first page in the pathway and not the full pathway..

for example 'Homepage >'

where it should say 'Homepage > page 1'

as AmyStephen put it "there are no breadcrumbs"
Yes! I always have coffee when I watch radar. You know that.

rembrandt
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Dec 19, 2005 5:37 pm
Contact:

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by rembrandt » Mon Nov 13, 2006 6:37 am

???I am having this, or a similar problem.  My read more and latest posts and poll results go to a blank page.  When I link a content item to a menu it works.  When I publish it to the front page, the read more links are broken.  The working links look like this:  http://www.dirt.com/site/content/view/142/150/&nbsp;     The broken links look like this:  http://www.dirt.com/site/content/view/142/

I just upgraded to 1.0.11 and still have the problem.  Can anyone help?

simonknee
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Wed Aug 16, 2006 3:46 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by simonknee » Mon Nov 13, 2006 9:51 am

How did you do the upgrade. If it was by ftp to your site then check that your ftp client will overwrite all the files regardless of date. I had a setting in WS_ftp that mean't it didn't update if the files were newer on the server.

Simon

rembrandt
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Dec 19, 2005 5:37 pm
Contact:

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by rembrandt » Mon Nov 13, 2006 3:29 pm

Yes I upgraded using FTP and overwrote all the files regardless of date. I'm  not sure, but I think I have had this problem for a while, since 1.0.8 - 1.0.11.  Maybe I should download the 1.0.11 full package and ftp all the files to my server, not just the patch? Do you think that would be a good idea?
Last edited by rembrandt on Mon Nov 13, 2006 3:37 pm, edited 1 time in total.

simonknee
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Wed Aug 16, 2006 3:46 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by simonknee » Mon Nov 13, 2006 3:47 pm

No, I only had to do the upgrade over and over until it actually stuck!

rembrandt
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Dec 19, 2005 5:37 pm
Contact:

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by rembrandt » Mon Nov 13, 2006 4:06 pm

I'm pretty sure the upgrade occured, it says Joomla! 1.0.11 Stable [ Sunbow ] 28 August 2006 20:00 UTC on my admin.  Problem is, I don't know when the error began.  I upgraded a couple of times lately and didn't notice the error right away.  Any other suggestions?  I am online at AIM at Remy88.  I can pay for support. :(
You do not have the required permissions to view the files attached to this post.

simonknee
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Wed Aug 16, 2006 3:46 pm

Re: [KNOWN ISSUE] Wrong itemid on frontpage

Post by simonknee » Mon Nov 13, 2006 5:03 pm

Check that you have a link in a menu that shows this content item in a content item blog. Doesn't have to display it (may be the 7th item on a blog that only shows 6 per page) but ensure it is included.

Another thought is that if it is in an item blog but you have set the blog to show more than one category.
Try reducing the number of categories to one (the one with your troublesome content item in)

Simon


Locked

Return to “Known Issues - Archive”