[pmwiki-devel] Testing empty string (was:php logic question)

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Thu Mar 15 04:37:30 CDT 2007


On Wed, 14 Mar 2007, Patrick R. Michaud wrote:

>> How about letting that be up to the administrator?
>
> Leaving this as an administrative option means we effectively have to 
> write *both* versions of the code -- one to display inline and one to 
> save messages until the end.  Ick.  It's already enough of a pain to be 
> doing one, much less both.

On the positive side, a functionality like this would be really 
appreciated by recipe developers. (I'd certianly use it)

> It's the same as an author writing (:if foobar:) -- the syntax is valid, 
> it's just that "foobar" isn't a defined condition.

That's a developers excuse you know :-)  As an author I'd, like to be 
warned about things that are likely typos or otherwise problematic. For 
instance, I'd expect "(:if fales:)" to signal a warning, because I 
intended it to be "(:if false:)" but did a typo.

Anyway, we're splitting hairs. What I'd like is for the conditional 
directives (and others such as pagelist) to somehow signal me in case of 
unrecognized arguments.

> Similarly, for
>
>    (:pagelist link=Test.Page1,Test.Page2:)
>
> the problem isn't really one of syntax, it's that PmWiki doesn't 
> understand the multiple dots in the pagename "Test.Page1,Test.Page2", 
> and thus is returning a value of "". (Remove one of the dots and you'll 
> see the "problem" go away.) Yes, this is likely a bug, but if we're 
> going to update the handling of the link= parameter anyway it doesn't 
> seem to be worth addressing.

I agree, not worth addressing.

>> Perhaps every markup rule could have an optional argument specifying the
>> warning/error message?
>
> This seems to assume that the "errors" that occur are all syntax related 
> -- it also seems to assume that every markup rule has only one 
> associated error or warning.  Many markups have multiple warnings that 
> can arise -- (:include:) comes quickly to mind, but there are others. 
> Even in the case of argument handling to (:pagelist:) there could be a 
> variety of "errors" that occur.

How about if the PmWiki core supplies an API for outputting "warning" 
messages? Then it's up to individual markup to do its thing?

As for an optional argument, I guess it's too much hassle.

Cheers
/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-devel mailing list