[ewiki] Re: function ewiki_render_wiki_links(&$o) page pluginshandling

Hey,

> I don't understand a recent change to ewiki_render_wiki_links() in my
> case-sensitive installation the new code to merge in the page plugins:
>
>       foreach ($ewiki_plugins["page"] as $page=>$uu) {
>          $ewiki_links[strtolower($page)] = "_d";
>       }
>       $ewiki_links = ewiki_array($ewiki_links);

I had to use the separate foreach() for page plugins instead of array_merge()
for both (db $links and plugins), because there was a problem with
number-only page names (there's a note in our SandBox, not yet moved into
bug reports).

A link like [2003] or [2004] was rendered with a "?" previously, even if
the database contained a page with such a name. The problem was the
array_merge() function. The ewiki_db("FIND") returned array("2003"=>"1")
correctly to denote existence of that page, but array_merge() then garbaged
this into $ewiki_links=array("0"=>"1") or so.

The problem is, that PHP does not provide datatypes for hashes and arrays
and we actually needed a hash_merge() function here instead of the cr...
array_merge().

   When I think of PHP5, I actually come to the conclusion to implement
   an own ewiki_array_merge() at some point...

> causes page plugins to not be recognized as extant.  They link properly but
> are drawn with the "?".  To my eye the old code was sufficent:
> ...
> since ewiki_array() automatically lowercases the keys in accord with the
> EWIKI_CASE_INSENSITIVE constant--in the new code this loop runs over the
> already lowercased page keys.

Yep, you're right, the ...[strtolower(...)] is of course nonsense here! And
if you had disabled the _CASE_INSENSITIVE, you would of course get bogus
"?" links, true.

So, lets just remove that again. I go and silently fix the R1.01c4 tarball
then also.


> [Andy]:
> I just saw the new rendering kernel in the CVS, when would you suggest I
> grab that and push it into production?

Not at all!  Without the new extension plugins it is of little use (they
are easy to do, but I still concentrate on finishing the core func). And
it will take some time to make the whole thing run fast again, write
useful (and required!) documention for extending it and finally consolidate
the new interfaces (I'd like to see unified standard format_*() func params
like all the ewiki page/action/handler/... plugins have).

The mixed type / blocks page feature is cool, but the real power lies in the
flags ($iii[...][1]). And I guess, there should be some tougher integration
with the rest of ewiki (access to page meta $data) - after all the new
ewiki_format() won't be extractable that easily like the old one.

But I hope it gets ready until next week.


mario

Other related posts: