CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Joomla Extensions (Moderator: lcdweb) »
  • Itemid issues in searching via profile
Pages: [1]

Author Topic: Itemid issues in searching via profile  (Read 4996 times)

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Itemid issues in searching via profile
October 28, 2011, 07:34:12 am
Joomla 1.5.23
CiviCRM 3.2

Looks like its impossible to pass an Item id to a civi search url
Scenario:
Have a joomla menu item pointing at search profile

Search results lose item id. Even if added manually into the url or appending the url the search results then return just the edit screen .
No  message nothing.

I can see a few patches in 3.4 on jira but will these fix 3.2?

As far as I can see its a real deal breaker for using Civi with Joomla

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Itemid issues in searching via profile
October 28, 2011, 08:12:50 am
yes -- we fixed this in 3.4. i think you should be fine backporting to 3.2. but you should do in a test environment just to make sure.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Itemid issues in searching via profile
October 28, 2011, 08:38:15 am
Tried patches and some.
Same result as manually adding Itemid manually to any segment of the URL. Get nothing back.
I'd expect a manually added item to the uRL to work but it seems simply adding the Itemid to a search results prevents the results from showing.

However what i have now found is that its only the Itemid of itself that causes the issue - passing another valid Itemid, eg for a new section menu item will result in search results being displayed - just not on its 'self'

Must be getting past it as I just want stuff to work



lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Itemid issues in searching via profile
October 28, 2011, 09:07:46 am
been a while since i did this...
try removing reset=1 from your menu item params. you may need to get into the db to do that.
the issue is that when Itemid is present, joomla looks at the params and uses those. we don't want reset=1 as part of the params or civicrm will reset the search form to the initial state -- form view with no data listed.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Itemid issues in searching via profile
October 28, 2011, 10:03:05 am
Thanks  appreciate the reply but cant make any sense of it. There is no rest=1 in the front end menu link to the profile, either in url, menu settings or the db.......:)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Itemid issues in searching via profile
October 29, 2011, 05:43:34 am
look in the jos_menu table for your menu item in question. the parameters field has a number of values set -- including "reset"
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Solved: Joomla Itemid issues in searching via profile
October 31, 2011, 05:38:31 am
Doh! Thanks

Ok Now i see - Civi is adding the param to the menu record in joomla menu table.
So my solution was to apply the url functionfrom here: http://issues.civicrm.org/jira/browse/CRM-8210

But I had to comment out the following for backward compatibility with 3.2:
   
Code: [Select]

   //require_once 'CRM/Utils/String.php';
   //  $path = CRM_Utils_String::stripPathChars( $path );


alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Itemid issues in searching via profile
October 31, 2011, 05:41:15 am
Spoke too soon.
The view of a single result does not have the item id passed to it.

Its the same issue of reset = 1 being passed in the link to view.

But where is this set?
« Last Edit: October 31, 2011, 05:45:56 am by alanski »

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Itemid issues in searching via profile
October 31, 2011, 05:53:20 am
Fixed this too by removing reset=1 and adding Itemid in to the static function &links

Changes for 3.2 I made were:
civicrm/CRM/Profile/Selector/Listings.php

changed:
Code: [Select]
            if ( $viewPermission ) {
                self::$_links[CRM_Core_Action::VIEW] = array(
                                                             'name'  => ts('View'),
                                                             'url'   => 'civicrm/profile/view',
                                                             'qs'    => 'reset=1&id=%%id%%&gid=%%gid%%',
                                                             'title' => ts('View Profile Details'),
                                                             );
            }
to:
Code: [Select]
if ( $viewPermission ) {
            $Itemid = JRequest::getVar("Itemid");
                self::$_links[CRM_Core_Action::VIEW] = array(
                                                             'name'  => ts('View'),
                                                             'url'   => 'civicrm/profile/view',
                                                             'qs'    => 'Itemid='.$Itemid.'&id=%%id%%&gid=%%gid%%',
                                                             'title' => ts('View Profile Details'),
                                                             );
            }

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Itemid issues in searching via profile
October 31, 2011, 07:42:23 am
Quote from: lcdweb on October 28, 2011, 09:07:46 am
been a while since i did this...
try removing reset=1 from your menu item params. you may need to get into the db to do that.
the issue is that when Itemid is present, joomla looks at the params and uses those. we don't want reset=1 as part of the params or civicrm will reset the search form to the initial state -- form view with no data listed.

Just realised what this means.
NOw I have Itemid passing I can never get back to a clean search form from a menu link to the profile. Because it sounds like and looks like Civis logic is if Itemid then add reset=1.
Sounds more useful to add reset based on the url segments/parameters like 'layout'

Ugh. Small success turns into minor failure and another Civi/Joomla head scratch.....

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Itemid issues in searching via profile - unsustainable fixes required
November 01, 2011, 04:41:31 pm
SOmetimes I wish I d never met Civi...

If you are reading this and using Civi 3.2 [couldnt verify on 3.4 demo, too complicated] the above doesn't work due to what I can only believe as a limitation of integration between Joomla menu Itemid and Civi profile search and its need to pass reset=1.

My solution was [Salesforce ..haha no]...my solution was to create ugly non-sustainable fix by hardcoding my menu ids in Joomla.php
Code: [Select]
$Itemid= JRequest::getVar("Itemid");
//reset itemd id to be not the same as self calling the profile
if($Itemid= 567) $Itemid=620;
                $Itemid = "{$separator}&Itemid={$Itemid}";
               
               
            }

Itemid 567 is the profile link, 620 is a child item simply a separator below the profile link.
I then had to hack the listings.php file as outlined above to pass the [child] Itemid, allowing search result listings and views to be shown and keep modules showing. It's totally unsustainable for adding more profiles.

Kind of wish I'd built it on Drupal. Makes me wonder why Civi + Joomla at all (said in complete self confessed ignorance  as I don't know what funky issues exist in Drupal)

Thanks LCD/Brian help on this - just enough to get me thru!

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Itemid issues in searching via profile
November 01, 2011, 05:43:15 pm
I wouldn't be quite so dim and grim about it (granted I'm biased). Civi works great with Joomla.
But for better or worse, Joomla is very dependent on the Itemid to manage page layout. In a multi-step form environment, that get's tricky, because you want to retain the Itemid, but not reset the form.

Of course, another option you had was to upgrade to the latest version -- which has improved this behavior.  ;)
And backporting can be tricky at times.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Joomla Extensions (Moderator: lcdweb) »
  • Itemid issues in searching via profile

This forum was archived on 2017-11-26.