SEF(standard/Joomsef) and false URL again (small bug + fix)

More
12 years 2 months ago #28541 by akd01
Hi,

After a reinstall I got a new behavior with joomsef/joomla standard SEF and flexicontent (this time it's the right one).

But when I type some kind of false URL I got interesting behaviors (rc8 1475 - some problems were already corrected from the 1465).

I got an error message of this kind on 1475 :
Code:
( ! ) Fatal error: Call to a member function get() on a non-object in C:\UwAmp\www\components\com_flexicontent\views\category\view.html.php on line 100 Call Stack # Time Memory Function Location 1 0.0007 350456 {main}( ) ..\index.php:0 2 0.2716 16125064 JSite->dispatch( ) ..\index.php:42 3 0.2730 16141792 JComponentHelper::renderComponent( ) ..\application.php:197 4 0.2779 16154232 JComponentHelper::executeComponent( ) ..\helper.php:351 5 0.2786 16243192 require_once( 'C:\UwAmp\www\components\com_flexicontent\flexicontent.php' ) ..\helper.php:383 6 0.3135 19235152 JController->execute( ) ..\flexicontent.php:93 7 0.3135 19235200 FlexicontentController->display( ) ..\controller.php:760 8 0.3136 19235232 JController->display( ) ..\controller.php:442 9 0.3265 20089984 FlexicontentViewCategory->display( )

To avoid it and got a message of this kind
Code:
Content category with id: 155454545, was not found or is not published

There's only 2 fixes to add.

In components/com_flexicontent/views/category/view.html.php

Add after line 92 :
Code:
$params = & $item->parameters; if($params != null) {
And line 603
Code:
parent::display($tpl); } }

In components/com_flexicontent/views/item/view.html.php

Add after line 108 :
Code:
$params = & $item->parameters; if($params != null) {
And line 389
Code:
parent::display($tpl); } }

I hope it will help.

Other thing, particular to Joomsef-Flexicontent linking :
To avoid getting an error with default 404 page from Joomsef, there's 2 way to act :
1- install and configure Joomsef before installing Flexicontent
2- Edit the 404 article Joomsef add in database to fill the field needed by Flexicontent to detect it (by default it only fills default joomla's content fields and the content is not detected by Flexicontent making it sending a "not found" message when we try to get a 404 error).

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #28564 by micker
Thanks fir sharing

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #28568 by ggppdk
Ok when a content category is not found, we need to raise a 404 not found error

But what you suggest, is strange the 404 category not found error is produced before the lines you suggest altering.

you see the 404 error is done by line 79:
$category = & $this->get('Category');

maybe you got the expected behavior for some other reason?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #28589 by akd01
I'm not sure what is happening exactly, but I tryed again after having deactivate joomla and joomsef SEF functionnality and was able to reproduce the bug for categories by putting any number that is not an existing category in the cid parameter.

For example :
Code:
http://localhost/index.php?option=com_flexicontent&view=category&cid=5555555555555

The line the error occurs is always the same (line 110), so after the get('Category'):
Code:
$clayout = $clayout ? $clayout : $params->get('clayout', 'blog');

The script acts the good way and I've checked that it goes through the models/category.php and raise well an error via line 977+
Code:
//Make sure the category is published if (!$this->_category) { JError::raiseError(404, JText::sprintf( 'Content category with id: %d, was not found or is not published', $this->_id )); return false; }

But I don't know why the execution of view.html.php is not stopped after the raise...(i'm far to be a php/joomla experimented dev)

Same for items by modifying the id parameters. For example :
Code:
http://localhost/index.php?option=com_flexicontent&view=item&cid=9&id=555555555555555555555555&Itemid=177

instead of
Code:
http://localhost/index.php?option=com_flexicontent&view=item&cid=9&id=31&Itemid=177
That is an available content on my site.

The error is always raised on line 115 of item/view.html.php :
Code:
$ilayout = $ilayout ? $ilayout : $params->get('ilayout', 'default');

I'm on Joomla 2.5.6 for now (if it can help).

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.412 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline