PDA

View Full Version : THIS_SCRIPT issue


soniceffect
07-11-2012, 09:17 PM
Hi Guys,
Seem to have a problem I cant solve.

In the top of the main page of my new modification I have the following


define('THIS_SCRIPT', 'dcSomepage');


The first line in one of my plugins is


if(THIS_SCRIPT=='dcSomepage'){


Now this works absolutly fine on my dev forum as I have been coding. However once I tested the installation of my modification on another installation I found that my main page was blank. On further looking it seems like THIS_SCRIPT wasnt set on first run. If I comment out the if block and run it I get my page fine. I can then safely put it back in and it works without an issue.

Please could someone let me know what Im doing wrong? Got a good modification I wanna release and this annoyin bug is the only thing stopping me LOL

EDIT: Odd thing is it worked on default skin, just not my custom skin ... Very strange

kh99
07-11-2012, 10:57 PM
Hmm...did you by any chance create a product file by editing the xml? I'm thinking maybe you have a strange invisible character in there that's making the code not work right. Otherwise I don't know (and I can't think why the style would matter).

soniceffect
07-12-2012, 04:22 PM
Nope. Created normally.

Im thinkin it must just me my style. I have made quite a lot of changes and testing it since have had no problems.

Badshah93
07-13-2012, 07:06 AM
What output this code gives ?

print_r(THIS_SCRIPT);

soniceffect
07-13-2012, 08:09 AM
What output this code gives ?

print_r(THIS_SCRIPT);

It seems this was a one off issue when I did a test installation on my dev site for some really strange reason. Havent been able to replicate the problem since at all, so would seem its a none issue. Cheers for your help though, is much appreciated.

soniceffect
07-14-2012, 12:22 PM
Ok apparently I am still having the same issue. Its almost like the name is not picked up until after the first run, however its only on my custom skin. Doesnt happen on the default skin at all. Even happens are upgrade