• Resolved rghvdberg

    (@rghvdberg)


    I have 2 wordpress sites. Both WP 4.7 and Simple Calendar 3.1.9

    One one of the sites, after clicking “Save Changes” the Google API Key field returns to blank. No events show up.

    On the working site the Api Key stays filled in and everything else works as expected.

    Can anyone help me debug this?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Nick Young

    (@nickyoung87)

    I would suggest running through this first so we can rule out any possible conflicts right away: https://docs.simplecalendar.io/troubleshooting-theme-plugin-widget-conflicts/

    I have the exact same problem. I have used the calendar before with exactly the same plugin and theme combinations without any problem, and couldn’t find any theme/plugin conflict this time either.

    Thread Starter rghvdberg

    (@rghvdberg)

    Disabling widgets, plugin, changing theme. Nothing helped
    I’m stuck

    Thread Starter rghvdberg

    (@rghvdberg)

    the site that works with the calendar has php 7.0.14

    the site that doesn’t work has php 7.1

    could that be an issue ?

    • This reply was modified 8 years, 1 month ago by rghvdberg.
    Plugin Contributor Nick Young

    (@nickyoung87)

    @hermanfr,

    If that’s the case then it could be a server setup difference. Make sure all these are met also: https://docs.simplecalendar.io/system-requirements/

    @rghvdberg,

    It could be. I know there is another ticket open right now having some issues with PHP7 that we are trying to figure out. I personally have not encountered any issues on PHP7.0.8, but that doesn’t really matter in this case if it works for me or not ??

    Are you able to try switching to something lower to test that out?

    I have the same problem… Anyone found a solution?

    Plugin Contributor Nick Young

    (@nickyoung87)

    I think it might be an issue with PHP 7.1+

    I run it on 7.0.x and don’t have the problem and have heard from another user that if he downgrades to 7.0.x that the errors went away for him.

    We do have this marked as a bug to look into.

    iizmoo

    (@iizmoo)

    I can confirm it’s a PHP 7.1x issue. Had a site on 7.1.2 with the issue described. All plugins turned off for debugging. Recompiled and reinstall 7.0.16 and it worked just fine.

    The only difference was the PHP version and I have not compiled in redis and memcached extensions for PHP. But I doubt the existent of those extension would impact this bug. All other environmental variables were the same.

    • This reply was modified 8 years ago by iizmoo.

    Hi Nick

    Is there any update on the issue reported here, regarding not able to save the API key? I am facing the same issue.

    Plugin Contributor Nick Young

    (@nickyoung87)

    Hello,

    First off, I apologize for the delay.

    The issue is just being on PHP 7.1.x. I don’t have an ETA when we will be able to get those issues resolved so right now it is best to use PHP 7.0.x if you are able to.

    I ran into this issue on an urgent project for a site running PHP 7.1.

    The issue appears to be in the validate(…) method in ~/includes/abstracts/admin_page.php

    $sanitized is initialized as a string (line 182), and then the foreach loop attempts to access named offsets as if it were an array (line 186).

    I was able to resolve the issue by making a small modification:

    
    public function validate( $settings ) {
    
    		$sanitized; //untyped declaration
    
    		if ( is_array( $settings ) ) {
    			$sanitized = array(); //initialize as array
    			foreach ( $settings as $k => $v ) {
    				$sanitized[ $k ] = simcal_sanitize_input( $v );
    			}
    		} else {
    			$sanitized = ''; //initialize as string
    			$sanitized = simcal_sanitize_input( $settings );
    		}
    
    		return $sanitized;
    	}
    

    @nickyoung87, maybe you can take a look for the next release?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Simple Calendar doesn’t ‘remember’ Google API Key’ is closed to new replies.