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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.1 Release Testing (Moderator: Kurund Jalmi) »
  • 4.1b3 - Issues with Event shortcodes
Pages: [1]

Author Topic: 4.1b3 - Issues with Event shortcodes  (Read 8739 times)

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
4.1b3 - Issues with Event shortcodes
January 27, 2012, 11:48:01 am
Dear all,

A couple of issues still exist with the event shortcodes, which are destroying the flow of the site:

1. When directed to an error page, the page reverts to /index.php?page=Civicrm instead of staying on the shortcode link, destroying appropriate formatting.

2. The default 'Thank You' Page template directs the user back to the page at the default address instead of the new shortcode address.

Anthony

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Re: 4.1b3 - Issues with Event shortcodes
January 27, 2012, 12:18:43 pm
Small addtional note: I have been unable to figure out how to change this in the code myself - but am more than willing to test any code samples on my installation to help.

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Re: 4.1b3 - Issues with Event shortcodes
February 03, 2012, 12:47:30 am
Dear all,

I don't mean to pedantic - but does anyone have a suggested resolution on  this?

Anthony

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 4.1b3 - Issues with Event shortcodes
February 03, 2012, 07:45:29 am

No :(

But can you post an issue on: http://issues.civicrm.org/ with this info. Also point to this forum topic

hopefully someone from the community will take a look at it and/or once of us will take a look at it when we are a bit less slammed

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 4.1b3 - Issues with Event shortcodes
February 03, 2012, 02:42:03 pm

1. I could not reproduce this locally. On errors, it came back to the same page with the errors displayed

2. I dont understand what you mean by this. Can you elaborate / explain in a different way

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Re: 4.1b3 - Issues with Event shortcodes
February 06, 2012, 01:13:22 am
Dear Lobo,

I will try and explain the shortcode issue better, using live examples from my websites. I have managed to reproduce this error on two different installations, using both permalinks and standard-links, and both for the events and contribution pages.

Event Page with Pretty Permalinks enabled
1. My event registration form is at: http://www.eurashe.eu/ac2012-reg/. As you can see 'ac2012-reg' is the civicrm page with the shortcode installed.
2. If you leave the form blank and click 'continue', so as to generate an error, you are taken to http://www.eurashe.eu/index.php?page=CiviCRM&q=civicrm/event/register
3. The page you should actually have been taken to, so as to keep the page template and structure in order is http://www.eurashe.eu/ac2012-reg?page=CiviCRM&q=civicrm/event/register

Contribution Page without Pretty Permalinks enabled
1. My signup form is at: http://crm.efquel.org/?page_id=4. As you can see '?page_id=4' is the civicrm page with the shortcode installed.
2. If you leave the form blank and click 'confirm contribution', so as to generate an error, you are taken to http://crm.efquel.org/index.php?page=CiviCRM&q=civicrm/contribute/transact&page_id=4
3. I'm not sure the exact URL formation in this combination, but again you have been redirected to a page which is nested under 'index.php' instead of under '?page_id=4' from a templating perspective.

I have registered a bug in the issue tracker to help - hope this explanation is easier to follow.

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Re: 4.1b3 - Issues with Event shortcodes
February 06, 2012, 01:26:18 am
In terms of the second issue:

The file templates/CRM/Event/Form/Registration/ThankYou.tpl contains teh following code:

Code: [Select]
   <div class="action-link section event_info_link-section">
        <a href="{crmURL p='civicrm/event/info' q="reset=1&id=`$event.id`"}">&raquo; {ts 1=$event.event_title}Back to "%1" event information{/ts}</a>
    </div>

The code is intended to send you back to the event page. However, as currently written, it sends you back to the 'default' event page, instead of the 'shortcode' event page.

Hope this is clearer. I also registered a bug report.

Anthony

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 4.1b3 - Issues with Event shortcodes
February 06, 2012, 07:22:02 am
Quote from: anthonycamilleri on February 06, 2012, 01:13:22 am
I will try and explain the shortcode issue better, using live examples from my websites. I have managed to reproduce this error on two different installations, using both permalinks and standard-links, and both for the events and contribution pages.

can you please reproduce this on our sandbox server:

http://sandbox.wordpress.civicrm.org/

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Re: 4.1b3 - Issues with Event shortcodes
February 06, 2012, 07:34:19 am
Hi Lobo,

After some extra testing on the sandbox, I have found that with default permalinks settings, the shortcode-error page works fine. The problem crops up, if you choose any of the other options under 'Settings > Permalinks' in a default WP install. (this is an extremely common configuration option).

I don't have access to change those settings on your test install, but if you would be so kind as to switch to the setting, I can easily reproduce the error on sandbox.

Thanks for all the support.

Anthony

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 4.1b3 - Issues with Event shortcodes
February 06, 2012, 07:40:36 am

for 4.1 we'll support only the default permanlink setting. maybe in a future version someone from the WP community will contribute code that supports the other options

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 4.1b3 - Issues with Event shortcodes
February 06, 2012, 09:23:29 am
Quote from: anthonycamilleri on February 06, 2012, 01:26:18 am
Code: [Select]
   <div class="action-link section event_info_link-section">
        <a href="{crmURL p='civicrm/event/info' q="reset=1&id=`$event.id`"}">&raquo; {ts 1=$event.event_title}Back to "%1" event information{/ts}</a>
    </div>

is this issue also related to the permalink setting being changed from the default setting?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Re: 4.1b3 - Issues with Event shortcodes
February 07, 2012, 02:50:15 am
Hi, yes, it is also related to the permalink setting. After a few hours of trying to figure it out, I have posted a fix in the issues tracker, which fully solves the issue.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 4.1b3 - Issues with Event shortcodes
February 07, 2012, 09:16:21 am

cool thanx.

there was one error, in which u referenced an unknown variable: $post. I eliminated that reference in the patch

ping me on IRC if u have any questions. thanx for taking a look and patching, much appreciated

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Anthony F. Camilleri

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: wordpress
  • MySQL version: 5.1
  • PHP version: 4.3
Re: 4.1b3 - Issues with Event shortcodes
February 09, 2012, 02:06:46 am
I tried the modification without $post - it breaks the functionality of the edit again. $post is one of the standard wordpress variables, therefore I believe it is included through the 'require' statements.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 4.1b3 - Issues with Event shortcodes
February 09, 2012, 10:52:19 am

can u apply this patch and check if it works:

Code: [Select]
Index: CRM/Utils/System/WordPress.php
===================================================================
--- CRM/Utils/System/WordPress.php      (revision 38787)
+++ CRM/Utils/System/WordPress.php      (working copy)
@@ -185,7 +185,8 @@
 
         if ( $config->userFrameworkFrontend ) {
             if ( get_option('permalink_structure') != '' ) {
-                $script = get_permalink( );
+                global $post;
+                $script = get_permalink( $post->ID );
             } else {
                 $script = 'index.php';
             }

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.1 Release Testing (Moderator: Kurund Jalmi) »
  • 4.1b3 - Issues with Event shortcodes

This forum was archived on 2017-11-26.