pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev2015-02-17 07:14 pm
Entry tags:

Question thread #28

It's time for another question thread!

The rules:

- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
quartzpebble: (Default)

Debugging help?

[personal profile] quartzpebble 2015-03-02 08:42 am (UTC)(link)
I'm working on bug 659: https://github.com/dreamwidth/dw-free/issues/659

I added what I thought ought to be a simple extra set of conditionals to check for whether there is in fact a parent comment and whether its author is the journal owner: https://github.com/fhocutt/dw-free/blob/bug659-screened-comment-incorrect-text/htdocs/talkpost_do.bml#L237

I get the following errors on /talkpost_do on my dreamhack when I try to respond to a screened comment left by somebody else:
[Error: /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml.text:81: Bogus format. at /dreamhack/home/8274-quartzpebble/dw/cgi-bin/LJ/Lang.pm line 592. ]

[Error: syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 227, near ") {" syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 230, near "} elsif" Global symbol "$commentu" requires explicit package name at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 230. Global symbol "$commentu" requires explicit package name at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 230. syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 232, near "} else" syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 235, near "} }" syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 280, near "; }" @ newhack.dreamwidth.net]

Google suggests that the "requires explicit package name" usually shows up when one doesn't use my, but it looks to me like $commentu is. Am I missing anything obvious?
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

Re: Debugging help?

[personal profile] fu 2015-03-02 05:36 pm (UTC)(link)
This line of code has a syntax error (unbalanced parentheses):

if ( $parentu && !($parentu->equals ( $journalu )) {

The other error messages may be red herrings -- that is, the syntax error prevents the next lines from being able to be read correctly, so they throw out misleading errors.
quartzpebble: (Default)

Re: Debugging help?

[personal profile] quartzpebble 2015-03-03 06:19 am (UTC)(link)
Yay, thank you!

Some of them were; others were complaining about tabs that had snuck into talkpost_do.bml.text somehow (I really don't know what was up with that, but they're out now).

Now I get:
Post Comment
Success
on talkpost_do for a screened comment, but no message body.

Is anything else obvious here?
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

Re: Debugging help?

[staff profile] denise 2015-03-03 06:28 am (UTC)(link)
Maybe a bit too obvious, but: have you tried running texttool.pl and restarting Apache?
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

Re: Debugging help?

[personal profile] fu 2015-03-03 06:39 am (UTC)(link)

Lost this line!

$ret .= “<?p " . BML::ml($mlcode, {'aopts' => "href='$commentlink'"}) . " p?>”;

quartzpebble: (Default)

Re: Debugging help?

[personal profile] quartzpebble 2015-03-03 07:29 pm (UTC)(link)

Yay, thank you! Now I can debug the logic itself...

fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

Re: Debugging help?

[personal profile] fu 2015-03-03 08:18 pm (UTC)(link)

Awesome. Good luck!