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) »
  • Can´t define New Menu Items
Pages: [1]

Author Topic: Can´t define New Menu Items  (Read 3037 times)

sanchez

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Can´t define New Menu Items
April 17, 2010, 08:14:36 am

Hi,

I have been able to define new events, memberships, contributions, etc, etc.

Every thing seems to work OK,  except that I am unable to define new menu itens in Joomla, for instance pointing to the Register for Event page, as the attachment shows.

As far as I cant tell, the function in select.php simply does not select anything.

Any clues?

--
Pedro Sanchez

Apis more modoque

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: Can´t define New Menu Items
April 17, 2010, 09:02:56 am
can you confirm that you have at least one event that is active and has online registration enabled?
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

sanchez

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: Can´t define New Menu Items
April 17, 2010, 09:08:51 am

> can you confirm that you have at least one event that is active and has online registration enabled?

Yes. I had one - the real one. Then, I created another just to check that issue. So, now I have two Events, both active and online enabled.

--
Pedro

Apis more modoque

sanchez

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: Can´t define New Menu Items
April 17, 2010, 10:21:33 am

Found that the code queries the database

SELECT id,title FROM civicrm_event WHERE is_active = 1 AND is_online_registration = 1 ORDER BY title,...

I have a multilingual system, so the query should be

SELECT id,title_pt_BR FROM civicrm_event WHERE is_active = 1 AND is_online_registration = 1 ORDER BY title_pt_BR,...

I didn´t find the reason yet.
Apis more modoque

sanchez

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: Can´t define New Menu Items
April 17, 2010, 10:37:34 am

Ah-Ha !!

Found something... This is a very very old issue, indeed.

http://issues.civicrm.org/jira/browse/CRM-4404

--
Pedro
Apis more modoque

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: Can´t define New Menu Items
April 17, 2010, 11:04:15 am
we should improve how resource lists are retrieved for these select boxes.
i'll give it some thought
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

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: Can´t define New Menu Items
April 17, 2010, 11:09:44 am
incidentally, you can always build the url to the event registration manually and then use the joomla menu item -- external url -- to link to it. not preferred, but workable
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

sanchez

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: Can´t define New Menu Items
April 17, 2010, 12:18:32 pm
Quote from: lcdweb on April 17, 2010, 11:09:44 am
incidentally, you can always build the url to the event registration manually and then use the joomla menu item -- external url -- to link to it. not preferred, but workable

Right, I think I will go that way.

I found that in some places the code refers to the original table names, for instance "civicrm_event", trying to fetch fields named with language sufixes, for instance, "title_pt_BR" - lets call this first scheme.

On the other hand, in some places the code refers to modified table names, "civicrm_event_ptBR", but then tries to fetch fields as originaly named, like "title" - lets call this the second scheme.

The issue this thread is about is caused because at that point the code queries a table named according to the first scheme, but tries to fetch fields named according to the second scheme.

Clearly, one solution would be to choose one of the schemes and stick to it. My opinion is that the second scheme would be a better option because all fields would keep their original names (no several similar fields like title_enUS, title_ptBR... title_xxYY), while the several translations could be easily segregated into easily identifiable tables.

Cheers,
Pedro
Apis more modoque

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: Can´t define New Menu Items
April 17, 2010, 09:35:10 pm
Can you try the attached files and see if they work with your multilingual install? I've restructured them so we don't hardcode the sql calls. The attached file is a zip file -- just rename to remove the .txt extension (had to do that in order to upload).

Save the zip file to: /components/com_civicrm/ and unpack it in that directory. It will do the following

- create directory 'elements' with two files - civievents.php, civieventsonline.php
- override: /views/Events/tmpl/defaults.xml
   and: /views/Events/tmpl/register.xml

The two xml files will now use the new JElement subclasses to generate the list of events -- both of which are based on Civi api instead of raw sql.

I'm not positive this will work for you, as I'm not sure how the api handles multilingual installs (if it does at all). But it's worth a try.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

sanchez

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: Can´t define New Menu Items
April 20, 2010, 07:50:58 pm

I was unable to download this file from the forum, so lcdweb made it available by a direct link from his site.

Well, his code worked like a charm. I tested it both in monolingual and multilingual environments.

Cheers and many thanks to lcdweb! This guy is a real master in his trade.

Apis more modoque

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Joomla Extensions (Moderator: lcdweb) »
  • Can´t define New Menu Items

This forum was archived on 2017-11-26.