1
Grover
Debug Info Question
  • 2005/4/27 16:06

  • Grover

  • Just popping in

  • Posts: 61

  • Since: 2005/2/13


Yesterday I made a couple changes to my site following which about a gazillion lines of debugging information appeared at the top of my main page. Here's a sample of the first three lines:

Quote:
Notice: Constant _SECONDS already defined in /home/himasar/public_html/modules/xp-weather/language/english/blocks.php on line 27

Notice: Constant _UNLIMITED already defined in /home/himasar/public_html/modules/xp-weather/language/english/main.php on line 27

Notice: Constant _ALREADY already defined in /home/himasar/public_html/modules/xp-weather/language/english/main.php on line 28


Any ideas what that's all about? The changes were as follows:

I replaced the site theme with a slightly hacked version from another site of mine. At the same time I added the module WF-Channel. Next time I visited the main page, the above debug info appeared. What does it mean?

2
tripmon
Re: Debug Info Question
  • 2005/4/27 17:16

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


It would seem that the same constants are named in multiple language files.

This can happen if for example:
WF_Sections uses:
_SECONDS

AND

XP_Weather ALSO uses:
_SECONDS

AND

Both modules (through either being inside the module, or displaying a block) end up trying to declare different values for the same constants.

They are just notices, and unless you see a problem, it's no big deal.

You can get rid of them by:
1)Not using the conflicting modules/blocks in tandem.
2)Changing the constant names (in the calling .php or .html files and the lang files) in one module or the other.

OR if it's not causing probs... just ignore it.. worst case is that in one of the modules will display inappropriate text, and that should be easy enough to see. (with debug off these notices will not appear)...

Often times, the constant may not even be used where it is throwing the notice, but is called in a background process (say when the block is generated). That's why I say... if things look right, just ignore it, as it won't affect functionality in any way aside from what I described above.

3
ackbarr
Re: Debug Info Question

here is a good place to interject that in a well written module, the constants are "sandboxed." That is, they are prefixed with the module name to prevent this sort of collision.

so instead of _SECONDS, a more appropriate constant name is:
_XFWEATHER_SECONDS, or possibly, _XFW_SECONDS

4
Grover
Re: Debug Info Question
  • 2005/4/28 1:32

  • Grover

  • Just popping in

  • Posts: 61

  • Since: 2005/2/13


Thanks for explaining that.

Does this extra activity of declaring values slow down the server at all?

Also is it possible that using two separate languages at the same time could cause that debugging activity? We are using the Japanese version of XOOPS but the module in question only includes -- I think -- English language files.

Login

Who's Online

136 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 136


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits