On Sonntag, 2. Dezember 2007, Thomas Bleher wrote:
> Hi!
>
> Stumbled across another issue today:
> If an annotation is incorrect an error text is added, even if
> $smwgNamespacesWithSemanticLinks is set to false for this particular
> namespace.
>
> Example:
> http://www.ppoe.at/leiter/wiwo/wiki/index.php/MediaWiki:Neuemethode-grundge
>ruest (This page is read by a special page where all the <<funny values>>
> are replaced by real data)
>
> I looked into the code (includes/SMW_Hooks.php) but found no really nice
> solution - basically, the code in smwfParserHook
>
>   $text = preg_replace_callback($semanticLinkPattern,
> 'smwfParsePropertiesCallback', $text);
>
> should pass either $parser or the value of
>
>   smwfIsSemanticsProcessed($parser->getTitle()->getNamespace())
>
> to smwfParsePropertiesCallback() so it can remove the error message if
> the namespace should have no semantic links. But as PHP supports neither
> callbacks with additional arguments nor closures, we are a bit stuck.
> Using $wgParser in the callback function is possible, though potentially
> buggy, as smwfParserHook may be called with another parser than the
> global one.  (I have an extension that does this :-/ )
>
> Suggestions welcome.

OK; I will have a look at this later.

>
> Two other questions:
>  65         //extract annotations and create tooltip
>  66         $properties = preg_split('/:[=|:]/', $property);
>
> This also matches :|, because | is not special in character classes. I
> think what you want is '/:[=:]/'.

Indeed. Fixed. I found a similar bug on line 27.

>
>  67         foreach($properties as $singleprop) {
>  68                 $dv =
> SMWFactbox::addProperty($singleprop,$value,$valueCaption); 69         }
>
> $dv is overwritten here on each iteration of the loop. This looks fishy.

Yes, but normally there is only one iteration anyway. What would you suggest 
instead?

Best regards,

Markus

-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362        fax +49 (0)721 608 5998
[EMAIL PROTECTED]        www  http://korrekt.org

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to