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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • custom field error from 2.16 to 2.2.0
Pages: 1 [2]

Author Topic: custom field error from 2.16 to 2.2.0  (Read 5679 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: custom field error from 2.16 to 2.2.0
March 18, 2009, 04:12:54 pm
To avoid issues like this in the future, would it makes sense to add a step in the CiviCRM upgrade documentation to "switch to a default Drupal theme such as Garland or Minelli" prior to upgrade?

This is a step in the Drupal upgrade procedure, maybe it should be one in the CiviCRM upgrade procedure too.
« Last Edit: March 18, 2009, 07:13:19 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: custom field error from 2.16 to 2.2.0
March 18, 2009, 10:16:48 pm
Yes we are already working in this and will be part of v2.2.1

Kurund
Found this reply helpful? Support CiviCRM

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: custom field error from 2.16 to 2.2.0
March 19, 2009, 04:49:33 am
Found better solution. Now drupal's drupal_maintenance_theme() during upgrade process.

I was also able to replicate the issue mentioned in this thread. This happens when you have Upcoming Event Block or any other custom block that accesses CiviCRM data using api's. During upgrade process we call Drupal's  theme(), which builds block hence you get this error. From now on during upgrade process we will switch to maintenance theme that would solve this problem. So this issue was not specific to any theme.

Fix will be part of CiviCRM v2.1.1.

Solution-
replace following line in civicrm/CRM/Upgrade/Page/Upgrade.php (around line 131) before starting with upgrade

Quote
echo CRM_Utils_System::theme( 'page', $content, true, $this->_print );
with:
Quote
echo CRM_Utils_System::theme( 'page', $content, true, $this->_print, false, true );

and

Quote
===================================================================
--- CRM/Utils/System.php   (revision 20341)
+++ CRM/Utils/System.php   (working copy)
@@ -130,13 +130,17 @@
      * @param string  $content the content that will be themed
      * @param array   $args    the args for the themeing function if any
      * @param boolean $print   are we displaying to the screen or bypassing theming?
-     * @param boolean $ret  should we echo or return output
+     * @param boolean $ret     should we echo or return output
+     * @param boolean $maintenance  for maintenance mode
      *
      * @return void           prints content on stdout
      * @access public
      */
-    function theme( $type, &$content, $args = null, $print = false, $ret = false ) {
+    function theme( $type, &$content, $args = null, $print = false, $ret = false, $maintenance = false ) {
         if ( function_exists( 'theme' ) && ! $print ) {
+            if ( $maintenance ) {
+                drupal_maintenance_theme();
+            }
             $out = theme( $type, $content, $args );


HTh
Kurund
Found this reply helpful? Support CiviCRM

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: custom field error from 2.16 to 2.2.0
February 15, 2010, 01:26:39 pm
Hi, I hate to bring this up again, but my theme on a particular client site really messed up the recent upgrade from 3.0.4 to 3.1.2.  Whereas in the past the /civicrm/upgrade/?reset=1 page used to switch to Garland theme, this particular time it didn't.  In fact, CiviCRM subbornly refused to show /civicrm/upgrade in any theme but our custom theme, even though after the first failed attempt I switched to Garland manually for the whole site, cleared all caches, turned Performance Caching off, cleared out templates_c.  What a mess!

Anyhow, eventually I had to physically delete our custom theme from the server before CiviCRM upgrade would actually work.  After the upgrade, I re-uploaded our custom theme and it works fine now.

I'm not sure anything should be done about this issue by the CiviCRM team, but I do want to share my experience if it helps others.  Custom themes can be a real pain

« Last Edit: February 15, 2010, 01:28:47 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: custom field error from 2.16 to 2.2.0
February 17, 2010, 11:02:13 am
only somewhat related ... I've found the drupal Page Theme module a fantastic way to manage which theme gets used in a civipath.  Its very powerful yet simple / elegant. 

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • custom field error from 2.16 to 2.2.0

This forum was archived on 2017-11-26.