Loading...
 

Tikiwiki-devel (mailman list mirror)


[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[48937] branches/12.x/lib/wiki-plugins/ wikiplugin_include.php

Hi Jonny,

> -----Message d'origine-----
> De : Jonny Bradley mailto:jonny@tiki.org
> Envoyé : 13 juin 2018 05:59
> À : Tiki developers <tikiwiki-devel@lists.sourceforge.net>
> Objet : Re: Tiki-devel Tikiwiki-cvs/svn SF.net SVN: tikiwiki:48937 branches/12.x/lib/wiki-plugins/
> wikiplugin_include.php
>
> Hi Chealer
>
> Below...
>

> > On 12 Jun 2018, at 18:39, Cloutier, Philippe (DGARI-Consultant) <Philippe.Cloutier.externe@mern-

> mffp.gouv.qc.ca> wrote:
> >
> > Hi Jonny,
> >
> >> -----Message d'origine-----
> >> De : Jonny Bradley mailto:jonny@tiki.org
> >> Envoyé : 12 juin 2018 07:17
> >> À : Tiki developers <tikiwiki-devel@lists.sourceforge.net>
> >> Objet : Re: Tiki-devel Tikiwiki-cvs/svn SF.net SVN: tikiwiki:48937 branches/12.x/lib/wiki-
> plugins/
> >> wikiplugin_include.php
> >>
> >> Hi Chealer (on dev list now),
> >>
> >> Good catch, however, i seem to remember vaguely that this was required if the included page
> >> differed in it's html setting from the parent, and also the section edit icons etc broke if used...
> >
> >
> > Right, according to the commit message anyway (which seems most logical).
> >
> >>
> >> I guess i could "make it optional" for those edge cases and put it back to how it was by default -
> sound
> >> ok?
> >
> >
> > It's not ideal to have to add a parameter making the interface heavier to let users choose between
> bugs, but I'm afraid there is no easy fix for both.
>
> Anyone have a better idea?


Well, we could parse inclusions (plugin calls) gradually, as they occur, so that headings are inserted at the right place (but that must not be a small safe change).

> > Regarding the parameter's description, I would find "but may break the order of headings in tables
> of contents." clearer and more accurate than "but will cause issues with the wiki table of contents."
>
> >> Ok, have done that in trunk in r66644 - i'm not too sure about the $parserlib->setOptions() line i
> >> restored which resets the parser options but it was there before, i think it's either redundant or
> may
> >> cause other issues, please let me know?
> >
> >
> > I am not sure what you mean saying you restored that line. There was a call to setOptions(), but not
> a call without argument, was there? The call doesn't look right in the parse_include_page false case.
> We are writing to a key of an $options variable which is not defined nor read. I think as happened up
> to r48937 $options should be declared (though perhaps not as null!) and the call to setOptions() should
> pass $options. So I'd say:
> >
> > if ($_REQUEST'page') {
> > $options = ['page' => $_REQUEST'page'];
> > } else {
> > $options = [];
> > }
> > $parserlib->setOptions($options);
> > $parserlib->parse_wiki_argvariable($text);
>
> Calling that function with an empty array is equivalent to calling it without a parameter, sorry, maybe i
> should have explained.


Right, but it was only called without a parameter if $_REQUEST'page' is not set.

> But mainly, does it work again now? :-)


I can't test it since I don't have a PHP version supporting trunk here, and I am not backporting now since we are not asked to solve this specific issue immediately (we are in the process of choosing between maketoc and client-side TOC-s, so we are comparing issues on each side; this one was reported last year).

I will report if I find a regression remains even if parse_included_page is disabled (for now I can just say the code is wrong, but I don't know how behavior will be affected since I don't know why parse_wiki_argvariable() is called).

>
> jonny
>
>
> >>
> >> Thanks!
> >>
> >> jonny
> >>
> >> p.s. wasn't there a similar thing Geza reported that i broke... oh yes, this one:
> >> https://sourceforge.net/p/tikiwiki/code/60555/ needs reverting too.
> >>

> >>> On 8 Jun 2018, at 22:25, Cloutier, Philippe (DGARI-Consultant) <Philippe.Cloutier.externe@mern-

> >> mffp.gouv.qc.ca> wrote:
> >>>
> >>> Thanks Jonny,
> >>> Since this changes the order in which content is parsed, this has the unfortunate side effect of
> >> breaking table of content entry order, as reported in ticket #5496: https://dev.tiki.org/item5496-
> >> Table-of-contents-entries-maketoc-in-wrong-order-when-wiki-pages-are-included
> >>>
> >>> Prior to this change, the whole "effective source" would be parsed by
> >> parse_data_process_maketoc() all at once, so $anch would be built in the right order.
> >>>
> >>>> Revision: 48937
> >>>> http://sourceforge.net/p/tikiwiki/code/48937
> >>>> Author: jonnybradley
> >>>> Date: 2013-12-03 17:38:37 +0000 (Tue, 03 Dec 2013)
> >>>> Log Message:
> >>>> -----------
> >>>> FIX include plugin: Respect included page's 'is_html' setting so line-breaks are always
> preserved
> >> when a wiki is included in an html one, or vice versa
> >>>>
> >>>> Modified Paths:
> >>>> --------------
> >>>> branches/12.x/lib/wiki-plugins/wikiplugin_include.php
> >>>>
> >>>> Modified: branches/12.x/lib/wiki-plugins/wikiplugin_include.php
> >>>> =============
> >>>> --- branches/12.x/lib/wiki-plugins/wikiplugin_include.php 2013-12-03 17:16:56 UTC (rev
> 48936)
> >>>> +++ branches/12.x/lib/wiki-plugins/wikiplugin_include.php 2013-12-03 17:38:37 UTC (rev
> >> 48937)
> >>>> @@ -14,6 +14,7 @@
> >>>> 'prefs' => array('wikiplugin_include'),
> >>>> 'icon' => 'img/icons/page_copy.png',
> >>>> 'tags' => array( 'basic' ),
> >>>> + 'format' => 'html',
> >>>> 'params' => array(
> >>>> 'page' => array(
> >>>> 'required' => true,
> >>>> @@ -139,12 +140,19 @@
> >>>> }
> >>>>
> >>>> $parserlib = TikiLib::lib('parser');
> >>>> - $options = null;
> >>>> + $old_options = $parserlib->option;
> >>>> + $options = array(
> >>>> + 'is_html' => $data$memo'is_html',
> >>>> + 'suppress_icons' => true,
> >>>> + );
> >>>> if (!empty($_REQUEST'page')) {
> >>>> $options'page' = $_REQUEST'page';
> >>>> }
> >>>> $parserlib->setOptions($options);
> >>>> $parserlib->parse_wiki_argvariable($text);
> >>>> + $text = $parserlib->parse_data($text, $options);
> >>>> + $parserlib->setOptions($old_options);
> >>>> +
> >>>> // append an edit button
> >>>> if (isset($perms) && $perms'tiki_p_edit' === 'y' && strpos($_SERVER'PHP_SELF', 'tiki-
> >> send_newsletters.php') === false) {
> >>>> global $smarty;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
TikiWiki-devel mailing list
TikiWiki-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.