Dear Leevi (and others),
I’ve just recently purchased a new laptop and am running a XAMPP local server. Haven’t installed much add-on’s yet, but upon creating a new MSM site, I am receiving the following types of errors in CP on any sites other than the default:
Notice: Undefined index: 2 in C:\Program Files\XAMPP\htdocs\ExpressionEngine\system\extensions\ext.lg_add_sitename.php on line 432 Notice: Undefined index: 2 in C:\Program Files\XAMPP\htdocs\ExpressionEngine\system\extensions\ext.lg_quarantine_ext.php on line 141
The lines in question at these lines seem to be:
ext.lg_add_sitename.php:
$settings = ($return_all === TRUE) ? $SESS->cache[LG_ASN_addon_id]['settings'] : $SESS->cache[LG_ASN_addon_id]['settings'][$PREFS->ini('site_id')];
ext.lg_quarantine_exp.php:
$settings = ($return_all === TRUE) ? $SESS->cache['lg'][LG_QUA_addon_id]['settings'] : $SESS->cache['lg'][LG_QUA_addon_id]['settings'][$PREFS->ini('site_id')];
Any help is appreciated. This is very likely not exclusive to LG add-ons, but at the moment, these are what I’ve seen so far - Be great if I can relieve of the issues incase it’s more of an MSM-centric issue/setup problem. I’ve also noticed that the Sites tab hover over do not produce the menus when on sites other than the default.
Any ideas are appreciated.
Cheers, Danny
Hey Danny,
This issue has been reported but I haven’t been able to develop a automatic fix for it.
Here’s some background info:
Each sites settings is stored in a single multi-dimensional array with the site_id as the key. So when you create a new site the settings form looks for the site_id in the settings array which does not exist yet.
So the solution… when you create a new site just go into the extension settings for the new site and re-enter any information you need. When the settings are saved a new array key will be created and everything will work fine again.
I know its not the best solution for now but its quite an easy one. Your clients will never really see this error as its generally the developers creating the new sites so they should apply the new settings at the same time.
What I would love to see (adding a feature request after this) is a add_new_site hook. Then I could pull the default settings in and create a new array key. I guess another way to fix the issue would be to check to see if the array key exists when the settings are loaded and if not create a new one with some defaults. When I get a spare second to come up for air I’ll find and implement the best solution.
I guess the other thing to mention that LG Sitename like most of my other extensions is freeware so implementing some fixes may take a bit longer as they aren’t the same priority as paid client work; which of course you can understand.
Cheers Leevi
Leevi,
Tried what you suggested, and it seemed to do the trick. No worries on getting it fixed if you have other priorities. The important thing is that they work as advertised - and well, it’s free - what can I say? I’m just gracious for your support for the community. Will no doubt be picking up your commercial endeavors as I had with Better Meta.
So the solution… when you create a new site just go into the extension settings for the new site and re-enter any information you need. When the settings are saved a new array key will be created and everything will work fine again.
I’m having this error as well. Your solution does seem to work thus far. However, I’m noting that all the information entered by default into the extension settings fields is missing completely - I’m having to consult the docs one by one to get things like the CSS for Add Sitename, the JS API URL, etc. I suppose I can get them from the other site, but it’s an obstacle nonetheless.
I did see your comment about these being freeware, and supported in your free time - thank you sincerely for sharing your time and work with us, it’s really appreciated. Update: I see, I was supposed to touch & re-submit the info from the parent site, not the newly created MSM site. That did the trick, with no missing fields (slaps head). Never mind! Except the thanks-for-your-freeware comments. =)
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.