xoops forums

ghia

Community Support Member
Posted on: 2008/12/23 16:45
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#11

Re: Notification not working

Can you send other emails with the site (eg registration)?
Is notification working on some modules? Which are and which not?
Is the notification method enabled and set to email?

davidsless

Just popping in
Posted on: 2008/12/23 23:10
davidsless
davidsless (Show more)
Just popping in
Posts: 49
Since: 2006/10/5
#12

Re: Notification not working

I have just ran some tests.

We ca send emails to groups and individuals.

Registration emails all work

Notification does not work on any installed modules. The ones tested are smartsection, olédrion, and newbbex.


davidsless

Just popping in
Posted on: 2008/12/23 23:15
davidsless
davidsless (Show more)
Just popping in
Posts: 49
Since: 2006/10/5
#13

Re: Notification not working

just noticed the following error message when trying to update notifications in smartsection:

[Fatal error: Call to a member function notLoaded() on a non-object in /home/communic/public_html/modules/smartsection/category.php on line 20
All errors (1) queries (5) blocks (0) extra (0) timers (3)
Errors
Notice: Only variable references should be returned by reference in file /modules/smartsection/class/category.php line 435

hervet

Friend of XOOPS
Posted on: 2009/1/14 10:25
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#14

Re: Notification not working

David had two problems:

1/ The notifications block is not updated when there is some cache on the modules
2/ There is a permissions problem (the linux/unix) user which runs Apache can't access the modules templates files

hervet

Friend of XOOPS
Posted on: 2009/1/14 13:26
hervet
hervet (Show more)
Friend of XOOPS
Posts: 2267
Since: 2003/11/4
#15

Re: Notification not working

Problem definitively solved.

In this folder:
/xoops/language
tehre was a sub folder called "cri".

Then, in the genral preferences, in the "Default language" select box, there was : "cri" selected.
Instead of “english”

As a consequence, XOOPS was trying to find, for each module, the notifications templates in this kind of folder:
/xoops/modules/mymodule/language/CRI/mail_template/notification_email.tpl

Instead of:
/Xoops/modules/mymodule/language/english/mail_template/notification_email.tpl

Of course, the mails templates of each module could not be found !

Hope this will help someone help because I spent a incredible amount of hours on this problem !

Where I did not had help: in Xoopsmailer.
Because each template is opened with something like this :
@fread(...)

So even with Php debug's mode activated, you can't detect that the mailer can't read the template file...
WTF !

davidsless

Just popping in
Posted on: 2009/1/17 0:32
davidsless
davidsless (Show more)
Just popping in
Posts: 49
Since: 2006/10/5
#16

Re: Notification not working

Many many thanks to Hervé who solved this problem. He put in many hours to fix this over and above. It's a measure of his dedication to and knowledge of XOOPS that he eventually tracked it down. A first class bit of work.

I am, of course, the cause of the problem in the first place. I created the CRI language folder so that we at CRI could customise the English on our site—communication.org.au— for our specific needs and users. In doing so we did not realise the programming implications of what we were doing.

For me this raises two important issues for the XOOPS community.

1. Already raised by Hervé, is the fact that the fault was not showing up in the debug mode. I don't know enough about programming to suggest a fix, but it should be possible to do so and should be added into the debug mode.

2. XOOPS is built to be customised: templates, themes, and languages are all modifiable. It's one of the things that makes XOOPS such a good platform. But it is not clear, as in this case, to a non-programmer, or someone unfamiliar with the overall architecture and dependencies of code are, where the limits of that customisation are, when a change is likely to have implications beyond the specific file one is working on. It might be helpful to all users if there were notes in folders and files signalling those limits.

I don't know how practical that is, but it might help people like me, who want to use XOOPS to the full, but would rather not create hidden nightmares for brave and highly competent people like Hervé to sort out.

This is just a suggestion. In the meantime hurray for for Hervé!

Mamba

Moderator
Posted on: 2009/1/17 2:29
Mamba
Mamba (Show more)
Moderator
Posts: 10760
Since: 2004/4/23
#17

Re: Notification not working

Yes, Hervé is D'Man!!! One of the best XOOPS developers, and his modules speak volumes about it!!!

Thanks Hervé for making another XOOPS user a happy one!
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

ghia

Community Support Member
Posted on: 2009/1/17 18:42
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#18

Re: Notification not working

Quote:
Where I did not had help: in Xoopsmailer.
Because each template is opened with something like this :
@fread(...)

So even with Php debug's mode activated, you can't detect that the mailer can't read the template file...
This use of @ for the suppression of error messages in PHP is some kind of lazy programming. The program stays running, but the failed action is not executed and may impair subsequent processing.
Better is to check before trying to open a file or to read from it, that the file exists etc. It costs more code to prepair for some actions, but if it fails, users can be indicated about what and where is the problem.
Ideal the @ should not be used in XOOPS.
I believe the same problem exists in the code for the installation of modules. Nothing is showed and nobody has a clue why.
PHP5 can give easier and better error handling with the throw exception handling and try - catch blocks.

wishcraft

Module Developer
Posted on: 2009/6/5 9:10
wishcraft
wishcraft (Show more)
Module Developer
Posts: 3710
Since: 2007/5/18
#19

Re: Notification not working

Ok david's problem with newbbex, with the mode being set on xoops_version.php to Notifcation Send then Delete.

This was disable the quickest way possible.

Thanks.
Resized Image
www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/SimonXaies
github.com/Chronolabs-Cooperative
facebook.com/SimonSXaies