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) »
  • General Discussion (please no support requests here!) (Moderator: Michał Mach) »
  • Vetting WP 4.4.1 and CiviCRM 4.7
Pages: [1]

Author Topic: Vetting WP 4.4.1 and CiviCRM 4.7  (Read 668 times)

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Vetting WP 4.4.1 and CiviCRM 4.7
February 02, 2016, 02:20:33 pm
Hi - previously, I ran CiviCRM under Drupal for a variety of activist installations.  Looks like I needed a lot of help, posting 463 times in this forum.

It has been a year or two, but I'm back and have installed CiviCRM under Wordpress, since I never really figured out how to use Drupal other than to launch CiviCRM.   A few rather obvious things have come up, but I'm reluctant to jump into Stack Exchange with a possible bug until I've vetted it a little with interactions with others.   Previously same on this forum, I tried to not submit a bug until I was sure it was a bug and not something I did or an as intended situation.

Three initial things have come up.

(1) CiviCRM 4.7 under Wordpress 4.4.1 seems to be sluggish.  Might be my server, but don't remember it being as sluggish under Drupal.  I found a thread on Stack Exchange about this, but the only way that I could interact with the discussion seems to be to post an answer which I don't have:  I generally like to have exchanged a little with others with the same issue who may have found solutions and may not have.
http://civicrm.stackexchange.com/questions/4584/how-can-i-speed-up-civicrm-on-wordpress

(2) When I edit a contact, the first letter of the contact's first name is obscured by an icon  Seems pretty basic and unlikely to have been overlooked, so maybe because I'm using Firefox.   Again just curious if others are having this issue before suggesting there is an issue.

(3) When I click on the contacts name and go to the edit screen, I'm getting the error:
[first letter of the message is cut off here - maybe be related to #2 obove] cts parameter 1 to be array, null given in /home/mysite/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/Array.php on line 1037    I think I ran into similar in previous releases, not sure.  Certainly could be an installation error on my part.  Unlikely anyone running CiviCRM 4.7 under Wordpress would not have seen this.

Anyway, my questions is not with the specifics above (I can chase them) but with the new Stack Exchange site, is there a place there or on this forum that we can bat things around a little before suggesting there might be an issue.   I don't really see similar on http://civicrm.stackexchange.com/    I'll keep reviewing, but don't see all the different discussions sections like we have in this forum that helped me so much in the past.   

General discussion and suggestions?

I have read this post:
https://forum.civicrm.org/index.php?topic=36280.0
« Last Edit: February 02, 2016, 02:22:17 pm by Denver Dave »

Kevin Cristiano

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: WordPress
  • MySQL version: 5.6
  • PHP version: 5.6
Re: Vetting WP 4.4.1 and CiviCRM 4.7
February 02, 2016, 06:37:16 pm
Hi Denver Dave,

I work in CiviCRM WordPress so let me answer based on my experiences.

1) for a server I do recommend either a host that specializes in CiviCRM or using a VPS.  While I have not seen performance issues with WP 4.4 and CiviCRM, I must admit that I am running on my own servers and that maybe why.  I cannot comment on a sped difference with Drupal, as I only use Drupal for testing.  Andrew's suggestions on Stack Exchange are a good checklist. 

2) I am not seeing any issues editing contacts on my sites.   I do use Firefox, so I am not sure why this is occurring.   Can you post a screenshot?

3) I am not getting that error, not displayed or in the logs.   Based on your path, I am curious if you are running WP in a subdirectory of the webroot.  Is the URL to the home page different from the URL to the admin?  Foer example, is the home page http://example.com and the admin http://example.com/wordpress?


Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: Vetting WP 4.4.1 and CiviCRM 4.7
February 27, 2016, 08:53:51 am
Kevin thanks for the reply.  I am going to have to figure out if I'm going to try installing wordpress / civicrm again (not a big deal), switch back to drupal / civicrm, or revisit programs like phplist and sugar CRM.   When I went through this process quite a few years ago, I decided that CiviCRM was the best fit our needs and that was before wordpress was available, so I used drupal, never being able to do anything useful with drupal rather than launch civicrm.

In the past, the availability of this forum was critical to my success, I hope things have not changed.

= = = = = =
Since you asked, I did do a view source on the view contact page to get the entire error message which I suspect a field being missing in a table - the mystery is why others are not getting it:
b>Warning</b>:  array_keys() expects parameter 1 to be array, null given in <b>/home/myaccountname/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/Array.php</b> on line <b>1037</b><br />

I see civicrm 4.7.2 is now available, maybe I'll upgrade first and then if this doesn't solve the problem, uninstall and reinstall CiviCRM - wonder if I can do that without touching wordpress - I'll try.   I have a few custom fields - better check for the error before I recreate any of them.
« Last Edit: February 27, 2016, 09:01:05 am by Denver Dave »

Kevin Cristiano

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: WordPress
  • MySQL version: 5.6
  • PHP version: 5.6
Re: Vetting WP 4.4.1 and CiviCRM 4.7
February 27, 2016, 09:00:33 am
Hi Dave,

One thing to keep in mind, we do not (yet) support WordPress in it's own directory.   https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

So looking at your path /home/mysite/public_html/wordpress/  IF (and only if) the webroot is public_html and you are using index.php to point to the install in wordpress/ there will be errors.  If you merely installed WP in that directory (and all its files are in it) then you should be OK

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: Vetting WP 4.4.1 and CiviCRM 4.7
February 27, 2016, 09:35:39 am
Hi Kevin

You may have identified the potential issue.  For both wordpress and civicrm I uploaded the compressed files and used the cpanel extract to expand them each going to a separate directory (civicrm in the wordpress plug-in directory)  While I kind of like having WP in its own directory, for my current purpose, its probably not a big deal and may explain why while CiviCRM runs, I get errors that others are not getting.   

I wonder if I can just slide things around on the server - probably goof up a path somewhere.  --- I'll report back


Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: Vetting WP 4.4.1 and CiviCRM 4.7
February 28, 2016, 09:25:02 am
Thank you - I really appreciate having the opportunity to bat this around a little.

I uninstalled, deleted the databases and reinstalled with the wordpress files (not directory) at the document root.   

Now on Wordpress 4.4.2 and CiviCRM 4.7.2

When I ran they system before loading other than the default contact loaded by the install, I did not get the error messages.  However, after I added custom fields and played with the settings for the Individual Suffixes (which didn't seem to fit my needs at all) I had the errors displayed, even before I imported data.

It is interesting that the error message is displayed 6 times.  And by coincidence, there are 6 fields in the first block of custom fields (I have other blocks).   Added a 7th field in the first block of custom fields and now have 7 error messages (one more error message).  So I tried using the option to disable the first custom field block and now only 2 error messages appear.   What I think is the next block of custom fields has more than 2 fields, but 3 of the remaining 4 blocks of custom fields only have 2 fields, so I'm guessing what I think is the next block, CiviCRM does not - maybe order created or something.

Here is the code from line 1037 mentioned in the error message:

Quote
/**
   * Convert array where key(s) holds the actual value and value(s) as 1 into array of actual values
   *  Ex: array('foobar' => 1, 4 => 1) formatted into array('foobar', 4)
   *
   * @param array $array
   * @return void
   */
  public static function formatArrayKeys(&$array) {
    $keys = array_keys($array, 1);
    if (count($keys) > 1 ||
      (count($keys) == 1 &&
        (current($keys) > 1 ||
          is_string(current($keys)) ||
          (current($keys) == 1 && $array[1] == 1) // handle (0 => 4), (1 => 1)
        )
      )
    ) {
      $array = $keys;
    }
  }

Ideas?

A little more experimenting with the settings for the custom field blocks - when I change from inline to tab the error messages go away.   Maybe I'm not understanding what the collapse on display means, but I can't seem to keep the check box from being checked or for either the inline or the tab to keep the fields from not being collapsed, which seems like an unnecessary step, especially with tabs.

May be a bug, not sure, would love to hear from one other person running civicrm 4.7.2 and wordpress 4.4.2 that is using custom fields.  Running custom fields from tabs is adequate for me for now.

Thanks for you help
« Last Edit: February 28, 2016, 11:44:08 am by Denver Dave »

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: Vetting WP 4.4.1 and CiviCRM 4.7
February 28, 2016, 11:40:19 am
Interesting - for custom reports I seem to get the error perhaps one for each contact record.

I'm wondering if I should try the drupal version of CiviCRM instead of Wordpress.  Anyone else do this?

= = = == ==
February 29, 2016 update.
I installed CiviCRM 4.7.2 and drupal 7.43 (instead of wordpress) on an additional domain to see if I  had the same issues that I was experiencing with the Wordpress installation and custom fields.  I didn't text everything, but I did get the same warning messages on the drupal installation.  Also, on the drupal installation I didn't force the contact suffix field values, so looks like that was not causing the issues.

At this point, I'm wondering if the problem may be my use of checkboxes for custom fields.  When I get a chance I'll do more testing to see if the issue is any custom field or just certain types.  On the drupal installation, when I tried to delete custom fields, even with only 1 contact record, they system would hang.  Have not tried to delete the custom fields on the wordpress installation, just deactivated them.

Love to connect with others using custom fields on new installations.  I've used lots of custom fields with previous releases and didn't have this type of issue.

Will report back when I've done further testing.

= = = = = =
Update from 3/2/2016
The issue seems to have to do with my use of checkboxes to display the values for custom fields.  I used a lot of checkboxes in previous CiviCRM releases, but something may have changed.  Did an initial test with a straight alphanumeric field and also a field using radio buttons - no errors displayed when I clicked on contact. 

Retested with enabling custom fields with checkboxes - no errors, but then discovered that even though custom field screen says enabled - custom field block was not enabled on the contact display screen.  Converting each check box to radio buttons - seems to be solving the issue and allows custom field blocks to display.   Interesting.
« Last Edit: March 02, 2016, 09:06:44 pm by Denver Dave »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • General Discussion (please no support requests here!) (Moderator: Michał Mach) »
  • Vetting WP 4.4.1 and CiviCRM 4.7

This forum was archived on 2017-11-26.