• Resolved mpp32

    (@mpp32)


    RuntimeException thrown
    (full server name and path…) \wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\nextgen_addgallery_page\templates\upload_images.php is not a valid MVC template

    I have been frustrated by this problem for over a week and probably read every forum out there. Although I’ve seen similar postings re. “the not valid MVC template”, mine seems to be a bit different. At first, I thought this was a migration issue, but now it seems that it is not.

    Yes, I’m using a Windows hosting server. It’s IIS 7.5 which is apparently the most compatible with php and often used for wordpress. It’s running php 5.6, my wordpress is 4.5.2 and NextGen gallery Version 2.1.43.

    I developed a complete wordpress site with several NextGen galleries locally on my Windows PC using Wampserver3 and everything worked as intended. When I migrated to the live Windows webserver “correctly”, I could not go to any page that contained a NextGen gallery as I would get a similar Runtime Exception thrown with reference to the full server name along with the “\nextgen_addgallery_page\templates\ <file>.php is not a valid MVC template”. Furthermore, I could not add a gallery, I could not get into the Gallery Settings or Other Options. At each attempt I got the Runtime Exception. I could not even Customise my theme because when I clicked, I got…

    “Edit Add NextGEN Media RSS
    NextGEN Media RSS

    RuntimeException thrown

    (full path)\wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\widget\templates\form_mediarss.php is not a valid MVC template”

    By the way, in the error message, the server path name (or UNC name) is missing the 2 leading backslashes (a possible clue?)

    When I deactivated and deleted NextGen, I could only then customise my theme without error. Since I could not get at the reset tool within settings, I download the stand-alone reset plugin – but that did not change anything. I then installed the previous version of NextGen (2.1.31), but that also made no difference.

    I then deleted all my wordpress files on the server and deleted the database, followed by a fresh plain install of wordpress and fresh new database. After confirming all was good, I did not add any themes or any other plugin, I only installed NextGen. However, again, I cannot add a gallery, cannot go into gallery settings, cannot go into other options and I cannot customize my theme. I tried with Twenty Sixteen, Fifteen and Fourteen. I even installed the Reset tool again just in case and ran it – no difference. I contacted my hosting provider and got them to make sure all appropriate permissions were set on my web space along with writable folders. All other themes and plugins work fine, the only exception is NextGen. Again, I cannot customise any theme unless I remove NextGen from my site.

    It seemed to me that NextGen was the best image gallery plugin for my needs and after investing so much time into this I really don’t want to move on to a different solution. So I hope I can get some help in resolving this – thanks!

    https://www.ads-software.com/plugins/nextgen-gallery/

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter mpp32

    (@mpp32)

    Further to my post above, I mentioned that in the error message the server name path – UNC name was missing the 2 leading backslashes. As such, that means that the entire link is invalid and cannot be found.

    I have been working with my web hosting company support and the tech told me that he followed this so far up to the function find_template_abspath in file package.module.mvc.php.

    This function calculates the absolute path to the template and seems to be stripping the leading slashes from the path.

    Please advise – thanks!

    Plugin Contributor photocrati

    (@photocrati)

    @andromeda555 – That this happens with a clean install and only NextGEN Gallery activated while using a default WordPress Twenty series theme tends to point to a possible server environment issue over most anything else.

    What are you seeing under Gallery > Overview for your server settings? Are you able to see that page?

    Otherwise, please send us a Bug Report (https://imagely.com/report-bug/ … please reference this topic) so we can get a better look under the page at your site.

    Please include as many details as you can about your site and the issue at hand so we can move on this as fast as possible.

    Thanks!

    – Cais.

    Thread Starter mpp32

    (@mpp32)

    Thanks Cais,

    @andromeda555 ????

    I just submitted the bug report to expedite a solution. However to address your response: It appears that NGG does not load properly as the relevant files are not being loaded. Given that the runtime error shows the full absolute server path instead of the URL and that the leading slashes are missing from the server path in the message – I suspect the problem is similar to what rrhode reported here: https://www.ads-software.com/support/topic/solutions-to-missing-leading-slash-in-urls?replies=5. I guess I missed this post previously, but since you recently commented on this post – it seems like we’re on the right track. However the solution that rrhode offered – to modify the file: /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/package.module.mvc.php and change the line: return $retval; to: return ($retval[0] != “/”) ? “/” . $retval : $retval;

    …did not work for me as I just tried it. I don’t know enough of php to customise this further in a proper way. However, I believe the issue is in there somewhere.

    Also to clarify:
    As I point out in my original post, initially this was not a clean install but a migration of well running site on a custom theme and including the same version of NGG running on my windows pc. However, after dealing with this error for over a week and trying every suggestion offered online, I tried it with a clean install but still with the same result. It’s odd what you said that server issues arise on clean installs with default Twenty series themes. It would seem that if you take out complexity and limitless variables and remain with the simple default settings, this would have the highest probability of a successful install. I should assume that such a simple default scenario would have been tested and addressed long ago.

    I hope this and the bug report can lead to a quick solution – thanks!

    Thread Starter mpp32

    (@mpp32)

    I am obviously anxious to get this resolved quickly as I have an otherwise working site with NGG integrated that cannot go live on the web host and NGG is the only plugin in the way since I cannot even customize any theme as get this runtime error even on a fresh generic install.

    Thinking more about this, the required modules are not loading because of the error which seems to result from looking up the full physical absolute path including full server name to the files at runtime. Why would this even be necessary? And if necessary, something goes wrong in picking up this path. With the proper knowledge, it seems like an easy fix – likely with respect to the module: /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/package.module.mvc.php

    If this is a similar issue to https://www.ads-software.com/support/topic/solutions-to-missing-leading-slash-in-urls then to clarify, I am not using the Roots theme and I also tried to role back to NGG version 2.1.23 with the code modification (Solution 2) given by rrhode in that post – but no difference.

    By the way, I submitted my bug report yesterday including my Overview server settings and I did not receive any confirmation that the bug report was received. I only received confirmation of subscription to Imagely as a result. I’m not sure what the process is.

    I would be happy with even a temporary workaround i.e. code substitution as I don’t really want to rework my site with a different image plugin. Thanks.

    Now the “save”button works but error
    “Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2592 bytes) in /users/mind-life/www/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php on line 4253”
    is shown on the side
    The Webiside-URL is “https://mind-life.bplaced.net/?page_id=21&#8221;

    Thread Starter mpp32

    (@mpp32)

    This isn’t helpful. Why is this post being mixed up with that of andromeda555?

    Plugin Contributor photocrati

    (@photocrati)

    @andromeda555 – My apologies (to @mpp32 as well) for tagging you in this post, I am not certain how/why that happened but as is there appears to be a memory limit issue on your site. Please contact your web hosting service and have them increase your PHP Memory Limit. If that does not help to resolve your issue lets continue the conversation in your original topic.

    @mpp32 – We did receive your bug report and are reviewing it (I should be sending a response to it shortly). As it is, let’s keep the conversation in the Bug Report for the time being as splitting the conversation between two points can lead to even more confusion than this particular topic is beginning to suffer.

    – Cais.

    Benjamin

    (@benjaminowens)

    This will be finally be resolved in our next release. For those needing a patch modify nextgen-gallery/products/photocrati_nextgen/modules/fs/package.module.fs.php and around line 335 (at the end of join_paths(), before return $retval) add:

    // Check for and adjust Windows UNC paths (\\server\share\) for network mounted sites
    if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && substr($this->get_document_root(), 0, 2) === '\\\\')
        $retval = '\\\\' . $retval;

    OK I tried to add this and it ended up giving me a white screen of death ??

    I can get to the overview page and here are my server settings: (this is before the editing of package.module.fs.php)

    Operating System : WINNT (32 Bit)
    Server : Microsoft-IIS/8.5
    Memory usage : 25.62 MByte
    MYSQL Version : 5.6.29-76.2-56-log
    SQL Mode : NO_AUTO_CREATE_USER
    PHP Version : 5.6.22
    PHP Safe Mode : Off
    PHP Allow URL fopen : On
    PHP Memory Limit : 128
    PHP Max Upload Size : 8M
    PHP Max Post Size : 8M
    PCRE Backtracking Limit : 500000
    PHP Max Script Execute Time : 300s
    PHP Exif support : Yes ( V1.4 )
    PHP IPTC support : Yes
    PHP XML support : Yes

    Graphic Library

    GD Version : bundled (2.1.0 compatible)
    FreeType Support : Yes
    FreeType Linkage : with freetype
    T1Lib Support : No
    GIF Read Support : Yes
    GIF Create Support : Yes
    JPEG Support : Yes
    PNG Support : Yes
    WBMP Support : Yes
    XPM Support : Yes
    XBM Support : Yes
    WebP Support : Yes
    JIS-mapped Japanese Font Support : No

    Your instructions are kinda vague so here is what I did

    ON line 348 and 349 that is this code

    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                $retval = str_replace('/', DIRECTORY_SEPARATOR, $retval);

    and I replaced it with this:

    if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && substr($this->get_document_root(), 0, 2) === '\\\\')
        $retval = '\\\\' . $retval;'

    white screen of death happened

    then I noticed that you said add so I did this:

    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                $retval = str_replace('/', DIRECTORY_SEPARATOR, $retval);
            }
            // Check for and adjust Windows UNC paths (\\server\share\) for network mounted sites
    if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && substr($this->get_document_root(), 0, 2) === '\\\\')
        $retval = '\\\\' . $retval;

    Yet another white screen. are you missing { these?

    Please pretend that I am a 5 year old with ftp access and show me what this section of code should look like with your edit. Also is this the same fix for this error – \wp-content\plugins\nextgen-gallery 2\products\photocrati_nextgen\modules\nextgen_addgallery_page\templates\upload_images.php is not a valid MVC template

    Plugin Contributor photocrati

    (@photocrati)

    @https://www.ads-software.com/support/profile/slybug – Although it would be best for you to start a new topic, I would also recommend you send us a Bug Report (https://imagely.com/report-bug/ … please reference this topic) so we can get a better look under the page at your site.

    Please include as many details as you can about your site and the issue at hand so we can move on this as fast as possible.

    Thanks!

    – Cais.

    PS: A replacement file including the modification can be made available as needed via the Bug Report.

    I have the same problem as @slybug

    Plugin Contributor photocrati

    (@photocrati)

    @hfdjb – Please start your own topic so we can try to help you with your specific issue on your specific site.

    See https://codex.www.ads-software.com/Forum_Welcome#Where_To_Post

    Thanks!

    – Cais.

    I removed the plugin….it doesn’t work !
    I will try to install it again when you release a new version.

    Plugin Contributor photocrati

    (@photocrati)

    @hfdjb – Thanks for your update. If you continue to see issues in the future, again please start your own topic.

    – Cais.

    I Updated to 2.1.49 and its working now !!

    Thanks a lot!!

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘RuntimeException thrown – not a valid MVC template’ is closed to new replies.