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 »
  • 2.1 Release Testing »
  • ERROR: CiviContribute > Joomla 1.5 > New Contribution Page
Pages: [1]

Author Topic: ERROR: CiviContribute > Joomla 1.5 > New Contribution Page  (Read 12742 times)

Rick Deckard

  • Guest
ERROR: CiviContribute > Joomla 1.5 > New Contribution Page
September 28, 2008, 04:10:02 am
Hi there,

i've installed the latest beta available today (2.1 Beta 6) as described in the installtion instructions into a plain installation of Joomla 1.5.7. Everything went smooth and - except of the bad, inconsistent and uncomplete translation (which ist not too bad now) - looks good.

During tests and configuration i found an issue with CiviContribute. If you click on "New Contribution Page" a whit blank page appears. The log says this:

Code: [Select]
PHP Fatal error:  Call to undefined function array_fill_keys() in
<path>/administrator/components/com_civicrm/civicrm/CRM/Contribute/Form/ContributionPage.php on line 214, referer:
http://<domain>/administrator/index2.php?option=com_civicrm&task=civicrm/contribute&reset=1

There are also some notices:

Code: [Select]
PHP Notice:  unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Argument is not a string in
<path>/administrator/components/com_civicrm/civicrm/CRM/Core/Menu.php on line 615, referer: http://<domain>/administrator/index2.php?
option=com_civicrm&task=civicrm/contribute&reset=1

Hope this helps..

Regards,

Rick


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: ERROR: CiviContribute > Joomla 1.5 > New Contribution Page
September 28, 2008, 07:28:00 am

you need PHP 5.2 for CiviCRM

array_fill_keys is a 5.2 function (http://www.php.net/manual/en/function.array-fill-keys.php)

alternatively you can create a function to emulate array_fill_keys and use that function in your install

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

long.lethanh

  • Guest
Re: ERROR: CiviContribute > Joomla 1.5 > New Contribution Page
October 24, 2008, 11:26:06 am
try to add this in ContributionPage.php
Code: [Select]
<?php
if (! function_exists("array_fill_keys")) {
   function 
array_fill_keys($keys, $value) {
       return 
array_combine($keys, array_fill(0, count($keys), $value));
   }
}
?>

awarnock

  • Guest
Re: ERROR: CiviContribute > Joomla 1.5 > New Contribution Page
December 15, 2008, 08:26:55 pm
I'm getting the same error, only on every single page since - as far as I can tell - calling the CiviCRM menus exercises the error.  The message I get is:

Notice: unserialize() [function.unserialize]: Argument is not a string in /var/www/yhsalums/administrator/components/com_civicrm/civicrm/CRM/Core/Menu.php on line 615

I realize the problem is related to my PHP version but I can't easily upgrade PHP.  It would really help me to replace the function in the CiviCRM code (note Joomla v1.5 seems perfectly happy with this version of PHP).

I've tried taking the example function in this thread and putting it in various places in the code but it doesn't seem to be found.  Where should it go so that it's found by the call to Menu.php?  Alternatively, would it be possible for the CiviCRM code to check the PHP version and code around it?  That would be a nice, robust solution.

Thanks!

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: ERROR: CiviContribute > Joomla 1.5 > New Contribution Page
December 15, 2008, 08:59:51 pm
Quote from: awarnock on December 15, 2008, 08:26:55 pm
I'm getting the same error, only on every single page since - as far as I can tell - calling the CiviCRM menus exercises the error.  The message I get is:

Notice: unserialize() [function.unserialize]: Argument is not a string in /var/www/yhsalums/administrator/components/com_civicrm/civicrm/CRM/Core/Menu.php on line 615

Can you add the following debug statement:

CRM_Core_Error::debug( 'm', $menu );

on line 612.

Quote from: awarnock on December 15, 2008, 08:26:55 pm
I've tried taking the example function in this thread and putting it in various places in the code but it doesn't seem to be found.  Where should it go so that it's found by the call to Menu.php?  Alternatively, would it be possible for the CiviCRM code to check the PHP version and code around it?  That would be a nice, robust solution.

This would need to be a community contributed and maintained solution. The core team does not have the energy or resources to support multiple PHP/MySQL/CMS versions

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

awarnock

  • Guest
Re: ERROR: CiviContribute > Joomla 1.5 > New Contribution Page
December 17, 2008, 01:25:17 pm
Quote from: Donald Lobo on December 15, 2008, 08:59:51 pm
Quote from: awarnock on December 15, 2008, 08:26:55 pm
I'm getting the same error, only on every single page since - as far as I can tell - calling the CiviCRM menus exercises the error.  The message I get is:

Notice: unserialize() [function.unserialize]: Argument is not a string in /var/www/yhsalums/administrator/components/com_civicrm/civicrm/CRM/Core/Menu.php on line 615

Can you add the following debug statement:

CRM_Core_Error::debug( 'm', $menu );

on line 612.

Sure.  Here you go - I had to remove some of the [breadcrumb] block to fit into the 20k message size limit here.  Let me know if that's the part you were looking for and I'll figure out how to make it fit.

Code: [Select]
m

CRM_Core_DAO_Menu Object
(
    [id] => 5
    [path] => civicrm/contact/search
    [path_arguments] =>
    [title] => Find Contacts
    [access_callback] => a:2:{i:0;s:19:"CRM_Core_Permission";i:1;s:9:"checkMenu";}
    [access_arguments] => a:2:{i:0;a:1:{i:0;s:14:"access CiviCRM";}i:1;s:3:"and";}
    [page_callback] => s:29:"CRM_Contact_Controller_Search";
    [page_arguments] => s:8:"mode=256";
    [breadcrumb] => a:1:{i:0;a:2:{s:5:"title";s:7:"CiviCRM";s:3:"url";s:100:"http://yhsalums.awcubed.com/administrator/index2.php?option=com_civicrm&amp;task=civicrm&amp;reset=1";}}
    [return_url] =>
    [return_url_args] =>
    [component_id] =>
    [is_active] =>
    [is_public] =>
    [is_exposed] =>
    [is_ssl] => 0
    [weight] => 10
    [type] => 1
    [page_type] => 1
    [_DB_DataObject_version] => 1.8.8
    [__table] => civicrm_menu
    [N] => 2
    [_database_dsn] =>
    [_database_dsn_md5] => e96d70566d16a872bea24a27cd9616ed
    [_database] => yhsalums
    [_query] =>
    [_DB_resultid] => 2
    [_resultFields] =>
    [_link_loaded] =>
    [_join] =>
    [_lastError] =>
)

m

CRM_Core_DAO_Menu Object
(
    [id] => 182
    [path] => navigation
    [path_arguments] =>
    [title] =>
    [access_callback] =>
    [access_arguments] =>
    [page_callback] =>
    [page_arguments] =>
    [breadcrumb] => a:33:{s:14:"0.CiviCRM Home";a:11:{s:3:"url";s:110:"http://yhsalums.awcubed.com/administrator/index2.php?option=com_civicrm&amp;task=civicrm/dashboard&amp;reset=1";s:5:"title";s:12:"CiviCRM Home";s:4:"path";s:17:"civicrm/dashboard";s:15:"access_callback";a:2:{i:0;s:19:"CRM_Core_Permission";i:1;s:9:"checkMenu";}s:16:"access_arguments";a:2:
...}
    [return_url] =>
    [return_url_args] =>
    [component_id] =>
    [is_active] =>
    [is_public] =>
    [is_exposed] =>
    [is_ssl] =>
    [weight] => 1
    [type] => 1
    [page_type] => 1
    [_DB_DataObject_version] => 1.8.8
    [__table] => civicrm_menu
    [N] => 2
    [_database_dsn] =>
    [_database_dsn_md5] => e96d70566d16a872bea24a27cd9616ed
    [_database] => yhsalums
    [_query] =>
    [_DB_resultid] => 2
    [_resultFields] =>
    [_link_loaded] =>
    [_join] =>
    [_lastError] =>
)

Followed by 4 repeats of:

Code: [Select]
Notice: unserialize() [function.unserialize]: Argument is not a string in /var/www/yhsalums/administrator/components/com_civicrm/civicrm/CRM/Core/Menu.php on line 616
Quote from: Donald Lobo on December 15, 2008, 08:59:51 pm

Quote from: awarnock on December 15, 2008, 08:26:55 pm
I've tried taking the example function in this thread and putting it in various places in the code but it doesn't seem to be found.  Where should it go so that it's found by the call to Menu.php?  Alternatively, would it be possible for the CiviCRM code to check the PHP version and code around it?  That would be a nice, robust solution.

This would need to be a community contributed and maintained solution. The core team does not have the energy or resources to support multiple PHP/MySQL/CMS versions

Yeah - I'm a software developer, so I know the drill.  Just wishful thinking on my part.  I was hoping it would be fairly easy to test for the presence of that one function (array_filll_keys) and code in a replacement if it wasn't found.  I haven't encountered anything in the underlying Joomla that requires the newer version of PHP that CiviCRM does.  Or maybe I should say that I haven't encountered anything yet.

I'm game to add code like the sample that's in this thread if you can point me to the place it needs to go.  I'm not terribly facile with PHP but I know my way around a little bit if you can give me some additional details.

Much appreciated!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.1 Release Testing »
  • ERROR: CiviContribute > Joomla 1.5 > New Contribution Page

This forum was archived on 2017-11-26.