• Thanks for a great plugin! I love it. πŸ™‚

    However, I am seeing this error message in my WP dashboard:

    Warning: array_merge(): Argument #2 is not an array in /home/pigzilla/public_html/wp-content/plugins/duracelltomi-google-tag-manager/admin/admin.php on line 1409

    Do you know what the issue could be? Any help would be great.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Thanks for mentioning this warning message.
    I’ve created a GitHub issue so that I can investigate this further:
    https://github.com/duracelltomi/gtm4wp/issues/121

    I have the same issue as of yesterday. Don’t know what caused it and its killing me :S

    Plugin Author Thomas Geiger

    (@duracelltomi)

    We are still working on a fix, you can check the conversation on this GitHub PR:
    https://github.com/duracelltomi/gtm4wp/pull/124

    Plugin Author Thomas Geiger

    (@duracelltomi)

    @rickwall @dannanelli could you apply this fix on a sandbox site to see whether it resolves the issue on your end?

    https://github.com/duracelltomi/gtm4wp/commit/0636a737d4970aaa7c97acdff76aebdfa9ac69da

    Hi Tomi,

    How do I test on a sandbox site? I can check today.

    Thanks!

    Ricky

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Ricky,

    Clone your live site so that all plugins, site data and options are kept.
    On the sendbox site, you will need to access and modify one file in the plugin folder of GTM4WP: admin/admin.php

    First, you will need to find the function called gtm4wp_show_warning()
    Inside, you need to find this row:

    $gtm4wp_user_notices_dismisses = get_user_meta( $current_user->ID, GTM4WP_USER_NOTICES_KEY, true );

    Below you will need to change the block with this code:

    if ( $gtm4wp_user_notices_dismisses === '' ) {
    	  if ( is_array( $gtm4wp_def_user_notices_dismisses ) ) {
    			$gtm4wp_user_notices_dismisses = $gtm4wp_def_user_notices_dismisses;
    	  } else {
    			$gtm4wp_user_notices_dismisses = array();
    	  }
    	} else {
    		$gtm4wp_user_notices_dismisses = @unserialize( $gtm4wp_user_notices_dismisses );
    		if ( false === $gtm4wp_user_notices_dismisses || !is_array( $gtm4wp_user_notices_dismisses ) ) {
    			$gtm4wp_user_notices_dismisses = array();
    		}
    	}
    	$gtm4wp_user_notices_dismisses = array_merge( $gtm4wp_def_user_notices_dismisses, $gtm4wp_user_notices_dismisses );

    Second, you will need to do the same in the gtm4wp_dismiss_notice() function.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Warning: array_merge()’ is closed to new replies.