Page 1 of 1

event_customarchive makes trouble with $view

Posted: Fri Jul 22, 2011 11:30 pm
by stm999999999
Hi!

After updating serendipity_event_customarchive I have a huge problem.

I use

Code: Select all

{if ($view == 'archives') || ($view == 'frontpage')}

{if ($view == 'categories')}

{if ($view == 'entry')}
in my entries.tpl.

But with the new update $view does not contain anything more!? Help!

Re: event_customarchive makes trouble with $view

Posted: Sat Jul 23, 2011 11:37 am
by Timbalu
You were updating from version to version?

Just a short question... the $view things in entries.tpl, what have they got to do with (custom)archives?

Did you read about customarchives?:

Code: Select all

SMARTY Function 'customArchive':
4 	
5 	This function allows you to display customized overviews of Serendipity
6 	Blog entries that have specific entryproperty plugin values. Those can
7 	be filtered, and you can use this smarty function to print out their
8 	sortings.
9 	
10 	{customArchive
11 	entryprops='Name,Lage,Groesse:m²,Personen,Preis:€,Bild,Teaser'
12 	sortfields='Name,Lage,Groesse:Größe,Personen:max. Personen,Preis:Preis ab'
13 	filter='Name'
14 	teaser='Teaser'
15 	picture='Bild'
16 	template='customarchive.tpl'
17 	limit='20'
18 	searchfields='Name+Lage+Teaser:Text:Suchwort,Groesse:Int:Größe von,Personen:Int:Personen von,Preis:Int:Preis von'
19 	valuelimit='Preis:0-100'}
20 	
21 	* entryprops
22 	
23 	Commaseparated list of all entryproperty key names (NO special characters!) as to be
24 	used in the readout of your entryproperty plugin configuration. Any key can use a ":"
25 	and then a unit that should be appended to each value, like "Price:$".
26 	
27 	* sortfields
28 	
29 	Commaseparated list of all entrypropertiey key names and how they should be printed
30 	out in the table. This is where you can alias key names with human readable fields
31 	by appending a ":" and then the real field name, like "custprice:Custom Price as seen on TV".
32 	They keys before the ":" need to be the same as in the "entryprops" configuration above.
33 	
34 	* filter
35 	
36 	The default entryproperty key name on which the table output will be sorted.
37 	
38 	* teaser
39 	
40 	The default entryproperty key name that is to be used as a fulltext teaser output from the
41 	related entries.
42 	
43 	* picture
44 	
45 	The default entryproperty key name that holds a picture of a blog entry
46 	
47 	* template
48 	
49 	The name of the template file that will render the table. See example customarchive.tpl file.
50 	
51 	* limit
52 	
53 	The number of entries to fetch.
54 	
55 	* searchfields
56 	
57 	Here you can specify a search form. For each search form input field you enter a block
58 	of variables: "fieldlist:type:display name".
59 	
60 	The 'fieldlist' contains a list of entryproperty key names of which fields will be searched
61 	in, separated with a "+".
62 	
63 	The 'type' can contain either "Text" (Fulltextsearch) or "Int" (Range from-to).
64 	
65 	The 'display name' tells what is displayed next to the input field of the resulting form.
66 	
67 	* valuelimit
68 	
69 	Can contain a default filtering in the format "Keyname:from-to". The keyname needs
70 	to be any of the 'entryprops' available field, "from" and "to" corresponds to any
71 	integer number.
72 	

Re: event_customarchive makes trouble with $view

Posted: Sat Jul 23, 2011 2:16 pm
by stm999999999
Timbalu wrote:You were updating from version to version?
sorry, I dunno my last plugin version. But if I should make an educated guess: the last or next to last version.

I update to the actual 1.11

:?: the only thing I do not understand: why did I update it just now. the actual version is from February :?:
Just a short question... the $view things in entries.tpl, what have they got to do with (custom)archives?
I dunno what, but I can only see the symptomss:

after updating some of my plugins yesterday I got the trouble. On two different systems!

Trying to determine the error I delete the updated plugins from the list and the customarchive plugin caused the problem: w/o it $view works.
Did you read about customarchives?:
Is this about the new "Added new smarty function to allow building for archive overviews based ..."?

Re: event_customarchive makes trouble with $view

Posted: Sat Jul 23, 2011 2:56 pm
by Timbalu
I cant see anything by now which could cause this problem....

The main addition in last was by adding the smarty function for custom filtering.
You could try and disable it on line ~611-12 with /* ... */

Code: Select all

/*
    serendipity_smarty_init();
    $serendipity['smarty']->register_function('customArchive', array($this, 'smarty_customArchive'));
*/
for a while. Maybe this helps, until we found the reason for missing $view.

Re: event_customarchive makes trouble with $view

Posted: Sat Jul 23, 2011 3:04 pm
by stm999999999
I had a test instance of my blog and I removed any event plugin except spartacus and Links to next/previous entry from the list:

$view is ok

adding customarchive: §view is empty

Re: event_customarchive makes trouble with $view

Posted: Sat Jul 23, 2011 3:09 pm
by stm999999999
Timbalu wrote:I cant see anything by now which could cause this problem....

The main addition in last was by adding the smarty function for custom filtering.
You could try and disable it on line ~611-12 with /* ... */
it works - so I think the problem must be placed somewhere in this function

Re: event_customarchive makes trouble with $view

Posted: Sat Jul 23, 2011 3:14 pm
by stm999999999
OK, looking into the code:

This has probably no effect to my problem, but @388 is this correct?

Code: Select all

        $_key_props = explode(',', $params['entryprops']);
        $key_props  = array();
one with _, one w/o?

Re: event_customarchive makes trouble with $view

Posted: Sat Jul 23, 2011 3:52 pm
by Timbalu
Did you also try mooving the plugin up or down the plugin tree?

It looks like $uri_addData gets lost or overwritten by the function trying to fetch a new $entries = serendipity_fetchEntries() extended array.
I suppose we have to wait for Garvin to patch this by merging the $uri_addData ('startpage', 'uriargs', 'view', 'viewtype') back into the stream.
one with _, one w/o?
No thats ok, since first is the array iterating through foreach and the second is the returning array.

Re: event_customarchive makes trouble with $view

Posted: Sat Jul 23, 2011 4:19 pm
by stm999999999
Timbalu wrote:Did you also try mooving the plugin up or down the plugin tree?
I removed any event plugin except spartacus and Links to next/previous entry from the list - no change.

But your suggestion $uri_addData sounds like a good idea. So, let us wait ... In the moment your workaround works.

Re: event_customarchive makes trouble with $view

Posted: Mon Aug 01, 2011 11:46 pm
by stm999999999
hm, ok. Let us waiting to Garvin. :D

Re: event_customarchive makes trouble with $view

Posted: Tue Aug 02, 2011 7:28 pm
by garvinhicking
Hi!

Yeah, I think the serendipity_smarty_init() command in the plugin makes trouble and does not initialize/set the proper view. I guess that the init function would need to fetch some additional parameters.

I won't have the time to thoroughly investigate this scenario in the near future though...

Re: event_customarchive makes trouble with $view

Posted: Wed Aug 10, 2011 2:39 pm
by Timbalu
Hi Stephan

Could you try and replace the customarchive

Code: Select all

serendipity_smarty_init();
with

Code: Select all

serendipity_smarty_init($serendipity['plugindata']['smartyvars']);
and have a look if that helps?

Or have a look if a

Code: Select all

print_r($serendipity['plugindata']['smartyvars']);
emits any data?