• Resolved mvctemplate

    (@mvctemplate)


    Hey there, just found a thread here that i think describes my problem but i am unsure on the resolution that was done at that time: https://www.ads-software.com/support/topic/errors-referencing-mvc-template/ (and unfortunately cannot comment on that thread which SUCKS because it breaks continuity of the problem but here we are)

    Background: I have inherited a wordpress site that was “frozen in time” at version 4.1.18. This was developed for my company as a one off project and i was warned never to update the site because of some hacked custom code or something like that. I am not a programmer.

    We have decided to move all websites to AWS cloud. So in the process of moving this site, i broke the gallery.

    Problem: Migrating the site to aws, and i get the error below on the gallery page:

    /var/app/current/SITENAME/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php is not a valid MVC template

    Additionally, in the apache error logs, the following is logged when i hit the gallery page:

    PHP Fatal error: Using $this when not in object context in /SITENAME/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php on line 3

    Other info: All files are the same, database is the same. We have moved from windows host to linux, but php is still version 5.6 on both (5.6.10 on windows 5.6.30 on aws).

    It seems like the rest of the website works fine, its just this one component that does not load. And it works fine on the currently live site.

    Any ideas? I tried to update just the “next gen” plugins but that breaks the site completely and i had to roll back. Doesnt seem like i can upload a picture to this forum, so i will just say that i am running the following versions of next gen plugins:

    NextGEN 3D and 2D Animated Flux Slider Template = Version 1.1.1

    NextGEN Flex Slider Template = Version 1.7

    NextGEN Gallery by Photocrati = Version 2.0.40

    NextGen Gallery Powertags = Version 1.6.4

    NextGEN Public Uploader = Version 1.8.1

    any help appreciated. Otherwise i have to leave this website running in house for now or decommission it, which no one wants to do. And they already said i cant hire a programmer to fix it.

    Additionally, i can see that this problem exists all over the web too. Examples:

    https://kanawha.us/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/

    https://duckduckgo.com/?q=nextgen_basic_gallery%2Ftemplates%2Fthumbnails%2Findex.php+is+not+a+valid+MVC+template&t=ffcm&ia=qa

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mvctemplate

    (@mvctemplate)

    actually, doing what was suggested (although not explicitly, has fixed the problem somewhat. Unfortunately, it just makes a vertical stream of images as opposed to a “cloud” as what was on the live site. The (half fix) was to add:

    $retval = $this->object->get_registry()->get_module_dir($module) . '/' . $settings->mvc_template_dirname . '/' . $path;

    in place of lines 242-247 in the file “\wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\mvc\class.mvc_view.php”

    Not ideal, but it does kind of work! not sure if that helps solve the problem though. The file does not exist in the updated plugins that broke the site (I kept a backup of the changed files and dont see a file at that path. So perhaps the entire structure of the plugin was changed in this component.

    Plugin Contributor Imagely

    (@imagely)

    @mvctemplate – There have been a great deal of changes to the plugin since the version you are referencing as your starting point. Also to note, we are only the author of NextGEN Gallery from your referenced list (some of which I am not familiar with and others are no longer supported to the best of our knowledge which may be contributing to the issues you are seeing).

    Also, migrating to AWS may be creating other issues although as it is, we do support current releases of our plugins and as such you may need to be updated to the latest release before we can offer much in the way of suggestions to look at for additional troubleshooting.

    Have you tried deactivating all of your plugins, clearing your browser cache (and site caches if you are using a caching plugin), then reactivating the NextGEN plugin?

    If this fixes the problem then it was likely one of the deactivated plugins that was causing an issue. Now, retrace your steps activating each plugin and re-checking to see if the problem returns. If it does then that last activated plugin was probably the one. Keep reactivating and in most cases it is also best to keep checking after each plugin, sometimes there may be more than one plugin on a site that will create an issue. If you do find one (or more) plugins causing this problem we would greatly appreciate your feedback on them so the developers may address them as soon as they can.

    Also to note, in rare cases it may be the theme itself that is causing a conflict so while you have just the NextGEN plugin activated you might consider temporarily switching to one of the default WordPress Twenty series themes and see if this corrects the issue as well.

    If the problem still persists after all of this we would still want to know, even more so, as we will still want to sort out the issue and may need additional details.

    Thanks!

    – Cais.

    Thread Starter mvctemplate

    (@mvctemplate)

    All fixed. The problem was symlinking the wp-content directory out of document root.

    I did an end run around this, by using vhosts in the apache config to just re map the whole website to the directory (on EFS storage) avoiding symlinks entirely, and thus the problem. Gallery now works, and is in the correct presentation.

    And i can move another website to the cloud. yay.

    Sorry i dont have more useful information for you guys, but it is an old version and i believe you did fix this “bug” with symlinks already, so i wouldn’t worry too much about it.

    I left the half fix above in the code because hey, it works so i am not going to touch it anymore.

    Plugin Contributor Imagely

    (@imagely)

    @mvctemplate – Thanks for the follow-up!

    – Cais.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘index.php is not a valid MVC template’ is closed to new replies.