Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted January 3Jan 3 Hi all, I've just done an update on my site, which was around 10 minor versions behind the latest. The actual update process seems to have worked as expected, but the theme I have (which was basically just the default theme with one addition to includeJS to add an external JS file only if the user is not in an array of user group IDs) seems to be intermittently screwing up with messages such as [[Template forums/front/forums/topicRow is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]] being displayed to users. My setup is on AWS using an auto-scaling group, and each of the servers on that group use the same server template and the filesystem is a mounted EBS drive so there is one shared filesystem across all of the servers. I have a suspicion, however, that the issue might be that things work fine on the first server but not on any subsequent ones that are built and added to the load balancer. I have tried disabling my customised theme and using only the default, but it still fails in the same way on that theme too. I am also seeing hundreds of thousands of these entries in the core_log table: Error: Call to undefined method IPS\forums\Topic\Post::shareableUrl() in /mnt/efs/saintswebfs/system/Theme/Theme.php(885) : eval()'d code:2422 Stack trace: #0 /mnt/efs/saintswebfs/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_forums_front_topics->postContainer(Object(IPS\forums\Topic), Object(IPS\forums\Topic\Post), Array, '') #1 /mnt/efs/saintswebfs/system/Theme/Theme.php(885) : eval()'d code(5211): IPS\Theme\_SandboxedTemplate->__call('postContainer', Array) #2 /mnt/efs/saintswebfs/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_forums_front_topics->topic(Object(IPS\forums\Topic), Array, NULL, Array, NULL, '\n\n\n\t\n\t<ul class...', Array) #3 /mnt/efs/saintswebfs/applications/forums/modules/front/forums/topic.php(576): IPS\Theme\_SandboxedTemplate->__call('topic', Array) #4 /mnt/efs/saintswebfs/system/Dispatcher/Controller.php(118): IPS\forums\modules\front\forums\_topic->manage() #5 /mnt/efs/saintswebfs/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute() #6 /mnt/efs/saintswebfs/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute() #7 /mnt/efs/saintswebfs/system/Dispatcher/Dispatcher.php(153): IPS\forums\modules\front\forums\_topic->execute() #8 /mnt/efs/saintswebfs/index.php(13): IPS\_Dispatcher->run() #9 {main} There are no errors being output to the browser console, e.g. 404s on the theme styling, etc. Is there something obvious that I'm missing here?
January 3Jan 3 Author As there were such minor changes, I decided to just get rid of it and build a new one from a copy of Default (basically changed the colours and added one snippet to includeJS), but that doesn't seem to have fixed it. The issues are happening when people are using Default as well as the newly-built custom theme.
January 3Jan 3 As a guest, I am not seeing any issues. I would recommend ensuring that members have been moved over to a compatible theme from their selection using theme tools available and then also disabling access to the broken theme.
January 3Jan 3 Author So I also ran the "Set members' theme" option on the Themes list in the ACP to set everybody to Default and that still hasn't fixed things. I think I'll just delete the new custom theme so there is just the Default one, and then build another version of the custom one from a clone of Default, see if that works. If everybody is using the Default theme, though, and the errors are still showing, surely that implies that the problem might not be the theme itself? 5 minutes ago, Jim M said: As a guest, I am not seeing any issues. One thing to try - click into one of the subforums, the main home view doesn't seem to have any issues, it all appears to start from the list view.
January 3Jan 3 5 minutes ago, SteveGrant1983 said: One thing to try - click into one of the subforums, the main home view doesn't seem to have any issues, it all appears to start from the list view. I have viewed forums and subforums along with categories without issue.
January 3Jan 3 Author 1 minute ago, Jim M said: I have viewed forums and subforums along with categories without issue. Interesting. I wonder if there's a problem with the conditional JavaScript snippet... {{if !\IPS\Request::i()->isAjax()}} {{if !\IPS\Member::loggedIn()->inGroup(array(4,6,7))}} <!-- BEGIN SNIPPET --> <script type="text/javascript"> // JS goes here </script> <!-- END SNIPPET --> {{endif}} {{endif}} Does that look correct? The pseudocode logic should be "if this isn't an AJAX request, and if the user is not in the user group IDs 4,6 or 7, output this code to the page HTML"
January 3Jan 3 Unfortunately, custom code is outside our scope of support. I can only say, if you think something may be an issue, remove it and test. The issue in general is related to: IPS\forums\Topic\Post::shareableUrl() So I don't think it is that though. Something, whether a third party application/plugin or part of the theme is calling that and creating an issue.
January 3Jan 3 Author OK no worries - do you have a link to the documentation on template custom code? Being able to include this snippet conditionally is vital for us in terms of fundraising (essentially those who don't pay a subscription fee get served with ads)
January 3Jan 3 Author Thanks for that - I guess what I was looking for was something a bit more complete, such as a class-by-class list of available methods and functions, if such a thing exists, rather than merely a broad overview of the concepts?
January 3Jan 3 Template syntax is effectively just PHP so we would not define that, no. We do not provide a definition of all our Classes utilized but this can be found in developer mode and some detail in our Developer docs:
January 3Jan 3 Author OK, so I've stripped everything back, removed all customisations, plugins, etc. However, I'm getting log table entries where a plugin is still somehow being hooked in, which seems very odd. If a plugin is disabled, surely it shouldn't be hooked in anywhere? And a different error message: OutOfRangeException: (0) #0 /mnt/efs/saintswebfs/applications/nexus/Application.php(226): IPS\Application\_Module::get('nexus', 'hosting', 'admin') #1 /mnt/efs/saintswebfs/system/Dispatcher/Admin.php(352): IPS\nexus\_Application->acpMenu() #2 /mnt/efs/saintswebfs/system/Dispatcher/Admin.php(68): IPS\Dispatcher\_Admin->buildMenu() #3 /mnt/efs/saintswebfs/system/Dispatcher/Dispatcher.php(110): IPS\Dispatcher\_Admin->init() #4 /mnt/efs/saintswebfs/admin/index.php(13): IPS\_Dispatcher::i() #5 {main} So that's something, I guess... Problem now is that I cannot get into the ACP as the "A configuration or server error has occurred" page appears. Is there some sort of manual method of clearing caches/datastores that might allow me to get back into the ACP?
January 6Jan 6 Have you tried using recovery mode? Check here for info https://invisioncommunity.com/4guides/client-services/getting-support-r292/#recoverymode
January 6Jan 6 Author Recovery mode didn't work for me at all, weirdly. In the end I went for a slightly different approach with the filesystem - originally I downloaded the incremental update package that the upgrader provides, uploading that to one of my servers, unzipping it and doing a recursive copy into the doc root, which looked like it worked but in practice obviously didn't; I then tried just using the full package from the client area instead and running the same recursive copy, and that seems to have fixed it, which might imply that the incremental package may not be quite right.