Post by ogun » Mon Jan 13, 2014 11:17 pm

Does anyone have any tips/tricks for vQmod debugging, or common vQmod 'gotcha's?

I'm looking at a problem at the moment that is either downright esoteric or staring me in the face (more likely the latter) - but as yet haven't cracked it. A file is not being parsed, despite another file in the same mod being parsed without issue (and nothing in the log).

This is a stripped down version that recreates the issue (library/document.php is parsed but library/cart.php is not):

Code: Select all

<modification>

	<id>TEST</id>
	<version>1.0</version>
	<vqmver>2.1.7</vqmver>
	<author>TEST</author>

	<file name="system/library/document.php">
        <operation>
            <search position="before"><![CDATA[private $title;]]></search>
            <add><![CDATA[// test]]></add>
        </operation>
	</file>

	<file name="system/library/cart.php">
        <operation>
            <search position="before"><![CDATA[private $config;]]></search>
            <add><![CDATA[// test]]></add>
        </operation>
	</file>

</modification>
Tried it with a few other files in the same folder (system/library), some are parsed and some are not - and I can't find a common property to explain why. Have tried checking line endings (all unix-style) and encoding (all utf8 without bom) and uninstalled every other mod - and moved on to getting more information from vQmod about what might be happening.

Unfortunately, I'm running on a remote server rather than something I can easily plug into the debugger on my IDE - so back to my question - Does anyone have any tips/tricks for vQmod debugging, or common vQMod 'gotcha's?

Active Member

Posts

Joined
Tue Aug 14, 2007 6:04 am

Post by MarketInSG » Mon Jan 13, 2014 11:42 pm

the best way is to check on the error logs. see what's there. Next, check that your index.php has vqmod modifications applied there


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by ogun » Tue Jan 14, 2014 12:40 am

There's nothing in the error log (that I haven't deliberately added myself), other vQmods work without issue and I don't have a vqprotect.txt. I also tried making a mod with deliberate errors just to make sure that VQMod would catch them and it did - which is what's making me think it's a problem with the files rather than vQmod itself (or its configuration).

I tried changing vQmod to add extra output (var_dumping the objects) to the log to make sure it was doing something, but that hasn't yielded any useful results yet. The output from VQMod::_parseMods for the first file in the example is the same as it is for the second, likewise in applyMod and VQModObject::_parseMods.

Active Member

Posts

Joined
Tue Aug 14, 2007 6:04 am

Post by ogun » Fri Jan 17, 2014 9:25 pm

Restarted the server for an unrelated job and suddenly it works perfectly again ::)

Active Member

Posts

Joined
Tue Aug 14, 2007 6:04 am
Who is online

Users browsing this forum: Bing [Bot] and 16 guests