Welcome, Guest. Please login or register.
Did you miss your activation email?

 
Advanced search

22734 Posts in 6698 Topics- by 17594 Members - Latest Member: permsk

21-07-2019 20:14:48
JOOM::GALLERY::FORUMArchiveJoomGallery 1.5 MVCFrontend(bug report) getJoomId
Pages: [1]
Print
Author Topic: (bug report) getJoomId  (Read 3139 times)
0 Members and 1 Guest are viewing this topic.
chrissy6930
Newbie
*
Offline Offline

Posts: 11


View Profile
« on: 08-04-2010 20:28:00 »

hi there,

I just noticed an odd begavior of mod_joomimg. I'm displaying only the latest x images in the categories of a specific user and have failed in adding the itemID of the respective menu item. the result was that 'some' joomgallery related itemID (19)was inserted not the components (16).

I have 4 joomgallery related menu items: component link in hidden menu, userpanel in usermenu, link to parent category of admin & chrissy

dumping menu table:
Code:
INSERT INTO `jos_menu` (`id`, `menutype`, `name`, `alias`, `link`, `type`, `published`, `parent`, `componentid`, `sublevel`, `ordering`, `checked_out`, `checked_out_time`, `pollid`, `browserNav`, `access`, `utaccess`, `params`, `lft`, `rgt`, `home`) VALUES
(16, 'hiddenmenu', 'Screenshots', 'screenshots', 'index.php?option=com_joomgallery', 'component', 1, 0, 51, 0, 3, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, 'page_title=\nshow_page_title=1\npageclass_sfx=\nmenu_image=-1\nsecure=0\n\n', 0, 0, 0),
(17, 'usermenu', 'Manage Screenshots', 'admin-screenshots', 'index.php?option=com_joomgallery&func=userpanel', 'url', 1, 0, 0, 0, 3, 0, '0000-00-00 00:00:00', 0, 0, 1, 0, 'menu_image=-1\n\n', 0, 0, 0),
(18, 'creatormenu', 'Screenshots Admin', 'screenshots-admin', 'index.php?option=com_joomgallery&func=viewcategory&catid=1&Itemid=18', 'url', 1, 0, 0, 0, 3, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, 'menu_image=-1\n\n', 0, 0, 0),
(19, 'creatormenu', 'Screenshots Chrissy', 'screenshots-chrissy', 'index.php?option=com_joomgallery&func=viewcategory&catid=2&Itemid=19', 'url', 1, 0, 0, 0, 4, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, 'menu_image=-1\n\n', 0, 0, 0);

I checked function getJoomId both in interface.class.php and modules.class.php
and since the query only returns the link with the highest ID it couldn't possibly be the component link which has the lowest ID here

instead of using
$database->setQuery(" SELECT id FROM #__menu WHERE link LIKE '%com_joomgallery%' AND access = '0' ORDER BY id DESC Limit 1 ");
I would suggest to swap that for:
$database->setQuery(" SELECT id FROM #__menu WHERE (type='component' OR type='components') AND link = 'index.php?option=com_joomgallery' AND published = '1' ");


« Last Edit: 09-04-2010 09:30:26 by chrissy6930 » Logged
Chraneco
Developer-Team
Hero Member
*****
Offline Offline

Posts: 3544


View Profile
« Reply #1 on: 09-04-2010 13:30:21 »

Hi,

which version of the module do you have installed?

Regards
Chraneco
Logged
chrissy6930
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #2 on: 10-04-2010 15:34:49 »

mod_joomimg 1.5.4
Logged
Chraneco
Developer-Team
Hero Member
*****
Offline Offline

Posts: 3544


View Profile
« Reply #3 on: 11-04-2010 12:57:47 »

Hi,

ok, please check the options of this module.

You are able to specify an Itemid there.

Regards
Chraneco
Logged
chrissy6930
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #4 on: 11-04-2010 13:25:41 »

ok, please check the options of this module.
You are able to specify an Itemid there.

I certainly can. however as the module manager says this field is
"Itemid which will be inserted in the links instead of the JoomGallery itemid"

if I want to link to the component it is to being left blank

in helper.php this is processed by
Code:
    $this->addConfig('itemid',$params->get('itemid', 0 ));
    if ($this->getConfig('itemid')!=0){
      $this->addConfig('itemidtxt','&Itemid='.$this->getConfig('itemid'));
    }else{
      $this->addConfig('itemidtxt',$this->getJoomId());
    }

if left blank function getJoomId is used for the itemid

the query in this function however does NOT return the id of the component link

your suggestion is therefore only a workaround to bypass the faulty query but certainly not a solution to fix the above mentioned bug
Logged
Chraneco
Developer-Team
Hero Member
*****
Offline Offline

Posts: 3544


View Profile
« Reply #5 on: 11-04-2010 13:36:27 »

Hi,

but if you want the module to use the Itemid of the component you will simply have to enter it there. I think it's '16' in your case.

The fix you propose will only return Itemids  to component links. If there isn't any component link to the gallery the query will return nothing instead of at least one Itemid of the gallery.

Regards
Chraneco
Logged
chrissy6930
Newbie
*
Offline Offline

Posts: 11


View Profile
« Reply #6 on: 11-04-2010 13:52:49 »

well...

if a link produced by a component comes without an itemid this is a clear indicator to the respective site admin that they should add a component link to some menu - a general rule for any J! site is't it?

or does JG not require a published component link for proper functionality?

sorry for not following the logic you are suggesting but the module's parameter clearly states that I should only enter an itemID if I want a link to a menu item NOT the component link. and the if clause in helper.php also suggests that function getJoomId is to return the component link and not anything else.
Logged
Pages: [1]
Print
Jump to:  

HOSTED BY SCHWARZKÜNSTLER ®

PROTECTED BY  ZB BLOCK  AND Project Honey Pot
Theme orange-lt created by panic

Bad Behavior has blocked 6971 access attempts in the last 7 days.