removing reference to googlesitemaps in silverstripe - php

I've recently moved a silverstripe site to a new server. Since then it's bringing up the error:
Fatal error: Class 'SiteTreeDecorator' not found in /home/priorysc/public_html/googlesitemaps/code/GoogleSitemapDecorator.php on line 9
I try removing the googlesitemaps folder, but then it just brings up the error that it can't find the googlesitemaps _config file. Is there any way I can remove the reference to googlesitemaps, or failing that just get the thing to work?
I'm a fairly verse php coder but I don't know that much about silverstripe as it's just been dumped on me.
Anyone know? I'm tearing my hair out over this!
-James

SiteTreeDecorator was a class that existed in v2.4 of SilverStripe, the fact that the error is saying it doesn't exist tells me you're running v3.0 or higher. Double check which version of SilverStripe you're running, then update the 'googlesitemaps' module to the appropriate version:
SilverStripe v3.0: https://github.com/silverstripe-labs/silverstripe-googlesitemaps/tree/1.1
SilverStripe v3.1: https://github.com/silverstripe-labs/silverstripe-googlesitemaps/tree/master

Related

Why do I get a"previously declared in" error

Jus tried to log in to my web admin and got this error:
Fatal error: Cannot redeclare oceanwp_webfonts_enqueue() (previously declared in /home/customer/www/ozdistributorsusa.com/public_html/wp-content/plugins/ocean-extra/includes/compatibility/ocean.php:94) in /home/customer/www/ozdistributorsusa.com/public_html/wp-content/themes/oceanwp/inc/customizer/controls/typography/webfonts.php on line 128
I can't get acces to the actual site either, any suggestions?
To fix it I manually commented the following functions in /wp-content/plugins/ocean-extra/includes/compatibility/ocean.php:
oceanwp_webfonts_enqueue()
ocean_get_google_font_css()
oceanwp_get_local_webfonts_data_dir()
oceanwp_get_local_webfonts_css_data_dir()
It was a "bad" update, which is now already fixed in 2.0.4 (https://wordpress.org/plugins/ocean-extra/#developers)
After commenting you can update that plugin via the panel or alternatively you can manually update it by removing the folder /wp-content/plugins/ocean-extra/ and uploading again the plugin.
I had the same problem, I got access by changing the theme via in the Database (VIA PHPmyAdmin) for one of the ones that comes by default (like twentytwenty).
I installed a new theme but the whole thing seems unstable still. If nothing better comes up I'm starting a fresh install.
oceanwp_webfonts_enqueue() function declare more than one. this function may be used in loop.

Array to string conversion - Project Crash [Laravel]

I am getting an error like this:
Array to string conversion
Inside:
/var/.../vendor/cartalyst/sentry/src/Cartalyst/Sentry/SentryServiceProvider.php
Code snippet where the error was thrown:
throw new \InvalidArgumentException("Invalid hasher [$hasher] chosen for Sentry.");
I was doing ordianry work in one of my controllers and this error occured when I clicked on one of the buttons inside my blade.
I have commented the code out but the error still is being displayed, not only on this one page but on every single one in my project. I can't even go to my /home/index.php page.
I have done
composer update
inside my project but that did not help. What can fix the problem?
#update
Yes I have checked sentry config file before I've made a new topic. I have the same problem when I load older versions (which do not contain the latest changes I've made today) of my project on to apache server which is running on Ubuntu 14.04.
Ideas what causes the problem?
In the config for Sentry you have to define a hasher.
It has to be a string. It can be 'native', 'bcrypt', 'sha256' or 'whirlpool'. Apparently in your app, it's not a string, but an array. Check your configuration. It's probably in app/config/packages/cartalyst/sentry/config.php

php, laravel, log4php: Class 'Apache\Log4php\Hierarchy' not found error

I'm new to php and i'm using log4php with laravel.
My project structure is
->Root
->Laravel
->app
->folderx
->abc.php
->otherfolders
.
.
->vendor
->composer.json (contains log4php and laravel)
->logconfig.xml
I'm trying to initialize the logger from inside abc.php,
Logger::configure('../../../logconfig.xml');
but it gives the error message
Class 'Apache\Log4php\Hierarchy' not found
I verified that the class Hierarchy.php exists in the vendor/apache/log4php/src under Root folder. Also, if I open Logger.php and go to the line where Hierarchy in initialized and ctrl+click(in eclipse) on Hierarchy, it takes me to Hierarchy.php.
I'm trying to figure out why php is not able to find that class.
Any help/suggestions would be greatly appreciated.
Thanks
That error message shows that your PHP is looking for a namespaced class. Log4PHP has never been released until now with namespaces (up to version 2.3.0), so this is definitely weird.
If you accidentially use the development branch of the 3.0 version, I must currently suggest not to use it. It barely got any significant commits in the last year, and should be considered work in progress (very slow progress unfortunately).

Call to undefined function menu_load() in .../public_html/includes/menu.inc on line 579

I really need your help. Actually, my journey begin with the installation Drupal and some modules. After a couple of days I suddenly get an issue "500 Internal Server Error".
I asked my hosting provider why this happened, he said "That because of the file .htaccess and you should add to this file php display error". So i did this and I get a new issue :
"Fatal error: Call to undefined function menu_load() in ...
/public_html/includes/menu.inc on line 579."
By the way, that's line 579
else {$return = $function($value);}
P.S: I am a beginner in PHP. I like Drupal a lot and want to study Drupal in further and create cool sites, but this problem...
need to figure out what function it's trying to call first.
change the line
else {$return = $function($value);}
to
else {echo $function;exit;$return = $function($value);}
Here are few tips:
make sure your Drupal core has all the files in the right place (especially menu module),
make sure your imported database is in UTF-8 format,
upgrade your Drupal core to the latest version (drush fr && drush up drupal)
clear all your caches (drush -y cc all), including your memcached (killall memcached),
rebuild your registry by using [Registry Rebuild][1],
if you're using modules which are implementing drupal_bootstrap() (such as Secure Site), disable them,
try disabling your PHP cache engines (such as XCache, Zend optimizer) to see if that's the problem,
test it on different environment/machine,
eventually restore your database from the point where it was working before

Can no longer install WordPress on MAMP- "Fatal error: Cannot redeclare class wpdb"

I've been developing WordPress sites for a long time on my local MAMP server. Now all of a sudden, it won't let me create any new sites. Whenever I set up a new one, instead of running the install script I get:
Fatal error: Cannot redeclare class
wpdb in
/Applications/MAMP/htdocs/[my_site]/wp-includes/wp-db.php
on line 52
This happens with all WordPress versions. I cannot thing of anything that would have caused this. I've done everything short of re-install MAMP. Does anyone have any ideas? I'm desperate at this point..
Check out the include path for php. It's likely that a second instance of wordpress is on the include path and is therefore conflicting with the one you're trying to load. It's also possible that a different package on the include path has a class called wpdb and is therefore causing a conflict.
wpdb is being created again some where, if this happened all of a sudden i suggest that you disable any plugins you've recently added. Or even better do a global find for the term class wpdb and see if that appears within more than 1 file. Also, check your functions.php file for a loop that might be loading wp-db.php more than once.
A workaround fix is to wrap the wpdp class in wp-includes/wp-db.php in the following:
Line 52:
if(class_exists('wpdb') != true)
{
class wpdb {
...
}
}
This solved the install issue- You could probably remove it after that, although it can't hurt to leave it I guess.
Still don't understand why this problem has popped up- If someone has an explanation I'd be eager to hear it.

Categories