wyntarvox: (Default)
wyntarvox ([personal profile] wyntarvox) wrote in [site community profile] dw_dev_training2011-03-06 10:21 pm

Packages

I'm working on bug 3479, and to implement it I want to create LJ::Event::JournalNewComment::Edited to overwrite the content method.

I copied cgi-bin/LJ/Event/JournalNewComment/TopLevel.pm (which seems to serve a similar purpose), renamed it to Edited.pm, changed the package name and overwrote the content method. In LJ::Talk I changed the fired event for edited comments to LJ::Event::JournalNewComment::Edited->new(), restarted apache (successfully), started the workers and edited a comment, but received no notification.

TheSchwartz queue shows the following error:

Can't locate object method "raw_params" via package "LJ::Event::JournalNewComment::Edited" at /dreamhack/home/8138-wyntarvox/dw/cgi-bin/LJ/ESN.pm line 123.

However, this method is defined in LJ::Event, of which JournalNewComment is a subclass, and Edited a subclass of that. Does inheritance not reach that far?
kareila: "PERL!" (perl)

[personal profile] kareila 2011-03-06 11:44 am (UTC)(link)
My first guess is that you need to add "use LJ::Event::JournalNewComment::Edited;" to the top of LJ/Talk.pm, so that it loads your package before attempting to use any of its methods.
kareila: (Default)

[personal profile] kareila 2011-03-06 08:51 pm (UTC)(link)
You're welcome! Don't be embarrassed, little oversights like that happen to everyone. :)