Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2014-01-01 17:21:33

etc
Developer
Registered: 2010-11-11
Posts: 5,157
Website GitHub

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

You should probably replace sort="posted asc" by sort="Posted asc" in <txp:article /> tags.

Happy 2014 everyone!

Offline

#14 2014-01-02 02:56:24

monicahu
Member
From: Sydney NSW
Registered: 2009-03-07
Posts: 69

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

maruchan wrote #277738:

I wonder: Does this plugin work instead? http://www.iut-fbleau.fr/projet/etc/index.php?id=19

I replaced the native TXP tags link_to_prev and link_to_next by etc_link_to but still kept the tags prev_title and next_title . Try on the forms for the blogs and sermons and the errors of undefined index disappeared. Thank you for your help!

Is there a bug with the tags link_to_prev and link_to_next in 4.5.5 ?

etc wrote #277741:

You should probably replace sort="posted asc" by sort="Posted asc" in <txp:article /> tags.

Thank you for your plugin! All the attributes for article tags are always in lower case, is there any spot that I have missed doing so?


Monica
Life with God is the purpose.

Offline

#15 2014-01-02 04:29:55

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

You’re welcome!

All the attributes for article tags are always in lower case, is there any spot that I have missed doing so?

I believe he meant that the attribute is supposed to say Posted as the database column for the posted date is case-sensitive and has a capital P.

Last edited by maruchan (2014-01-02 04:30:37)

Offline

#16 2014-01-02 12:13:25

monicahu
Member
From: Sydney NSW
Registered: 2009-03-07
Posts: 69

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

My remaining issues to resolve:
(1) Find a way to replace the plugins rss_suparchive to display article lists by date (year, then month, then day) and by topic (Category1 and Category2 with counts)

Have spent another few hours today going thru the TXP docs but still failed to get anything constructive.

(2) New issue in showing file download size [it seems I didn’t have a smooth upgrade like others :( ]

Instead of showing size in Mb I got this for using <txp:file_download_name /> [<txp:file_download_size format=“m” decimals=“2” />]:

20131222.mp3 [7.57units_m]

How can I override this “units_m” ? Problem solved – thanks Jukka!

Last edited by monicahu (2014-01-05 05:19:28)


Monica
Life with God is the purpose.

Offline

#17 2014-01-02 12:40:32

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

monicahu wrote #277750:

How can I override this “units_m” ?

That’s just a placeholder language string, used when you’re missing a translation. Update your language and it will be replaced with a proper translation — as long as the translation has that string in it.

Offline

#18 2014-01-02 13:00:43

monicahu
Member
From: Sydney NSW
Registered: 2009-03-07
Posts: 69

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

maruchan wrote #277747:

I believe he meant that the attribute is supposed to say Posted as the database column for the posted date is case-sensitive and has a capital P.

Your reply here triggered me to go through the docs on article_custom again and yes it said “Posted” instead of “posted” and “Category1” instead of “category1”. I updated all those article_custom lines and also restored my previous link_to_prev and link_to_next. And, miracle happened, no more *Undefined index” errors!

Great thanks to you and Oleg. (Now I don’t even need to use the plugin, etc_link_to.)


Monica
Life with God is the purpose.

Offline

#19 2014-01-02 13:06:29

monicahu
Member
From: Sydney NSW
Registered: 2009-03-07
Posts: 69

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

Gocom wrote #277751:

That’s just a placeholder language string, used when you’re missing a translation. Update your language and it will be replaced with a proper translation — as long as the translation has that string in it.

Thanks Jukka. Problem was solved after updating the language of English (Gt. Britain).


Monica
Life with God is the purpose.

Offline

#20 2014-01-02 14:49:13

etc
Developer
Registered: 2010-11-11
Posts: 5,157
Website GitHub

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

Glad you have solved it, just few remarks FYI:

  • db queries are case-insensitive, the problem comes from txp getPrevNext function (introdiced after 4.2 I believe) that yields the terms Posted, Expires and LastMod to be matched exactly. This is not a bug, but it could be less restrictive.
  • etc_link_to is useful only when you need a more complex sort order (involving multiple columns or computations) or for retrieving a range of neighbors (i.e. not only the nearest ones). For your case it would be an overkill.
  • I don’t know what rss_suparchive did, is it something like this? If so, let us know exactly what you need, etc_query might help.

Offline

#21 2014-01-02 14:58:33

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

monicahu wrote #277752:

[…] and also restored my previous link_to_prev and link_to_next. And, miracle happened, no more *Undefined index” errors!

That’s good to know, thanks.

Dear devs, is that something we could add to the manual (if so: where would it apply?) or might it be caused by a two way conflict?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#22 2014-01-03 09:33:19

monicahu
Member
From: Sydney NSW
Registered: 2009-03-07
Posts: 69

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

etc wrote #277754:

I don’t know what rss_suparchive did, is it something like this? If so, let us know exactly what you need, etc_query might help.

I am using rss_suparchive, rss_suparchive_bycat and rss_suparchive_menu for the main content and sidebar of two pages:

(1) A page which is connected to section archive_dates, and lists the article titles with hyperlink by year, month and day in the main content:
Articles by Dates
DEC 2013
  15: The Visiting King » by Steven Layson
  08: When God Became Human » by Steven Layson
  01: Parish Council Planning Day » by Steven Layson
NOV 2013
  24: The Prodigal Sons » by Steven Layson
  17: Brace Yourselves… » by Steven Layson
  10: Welcome to Thessalonica! » by Steven Layson
  03: People at Prayer » by Steven Layson
....

Articles come from sections called blog and news .

The sidebar menu lists the article counts by year with hyperlink back to this page as follows:

Archives by Dates
2013 (42 entries)
2012 (42 entries)
2011 (54 entries)
...

When the year link is clicked only the articles of the selected year are listed. For example, for 2013, article titles of Jan 2013 to Dec 2013 are shown (as above) in the main content of the same web page.

(2) A page which is connected to section archive_topics, and lists the article titles with hyperlink by category in the main content:
Articles by Topics
CHILDREN (3)
  Of Ethics and Scripture    by Steven Layson » 02 May 2010
  The Snow Queen    by Monica Hu » 29 Oct 2009
  For Children - How to Pray    by Monica Hu » 02 Sep 2009
CHRISTIANITY (4)
  The Christian and Poverty    by Steven Layson » 13 Mar 2011
  Whatever the moments, think of God    by Monica Hu » 02 Sep 2009
  Listen to These Young Men    by Monica Hu » 27 Aug 2009
  Welcome to Thessalonica!    by Steven Layson » 09 Aug 2009
....

Articles come from sections called blog and news where category1 or category2 may have values which are referred to as topics. The categories may be a child category. Category1 may be blank while Category2 has value for some articles.

The sidebar menu lists the article counts by category in ascending order of the category title with hyperlink back to this page as follows:

Archives by Topics
Children (3)
Christianity (4)
Connect09 (4)
Parish Council (1)
Food for Thoughts (4)
General (100)
Guest Section (10)
...

When the category link is clicked only the articles of the selected category are listed in the main content of the same web page.

Now there are many errors like this:

Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> ->  Notice: Undefined index:  excerpt while parsing form None on page archive
textpattern/lib/txplib_publish.php:426 rss_suparchive_bycat()
textpattern/lib/txplib_publish.php:326 processTags()
textpattern/publish/taghandlers.php:3789 parse()
textpattern/lib/txplib_publish.php:426 if_section()
textpattern/lib/txplib_publish.php:339 processTags()
textpattern/publish.php:544 parse()
index.php:83 textpattern()

Partial tag trace:

<txp:if_section name="archive_topics">
	[<txp:if_section name="archive_topics">: true]
	<txp:article status="sticky" form="simple_content" sort="Posted asc" />
		[filterAtts accepted]
		[SQL (0.000591993331909): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 5 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('archive_topics') order by Posted asc limit 0, 10]
		[Article 224]
		[SQL (0.000183820724487): select Form from txp_form where name='simple_content']
		[Form: simple_content]
		<txp:article_image class="article-image" />
		<txp:body />
	<txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" />
		[SQL (0.0457079410553): SELECT DISTINCT name FROM txp_category, textpattern WHERE name !="default" and type="article" and (category1 = name or category2 = name)  AND ( (section = 'blog') ) AND status=4  AND posted < now() ORDER BY name]
		[SQL (0.0451688766479): SELECT DISTINCT name FROM txp_category, textpattern WHERE name !="default" and type="article" and (category1 = name or category2 = name)  AND ( (section = 'blog') ) AND status=4  AND posted < now() ORDER BY name]
		[SQL (0.00284695625305): select *, unix_timestamp(Posted) as uPosted, ID, title, authorid, unix_timestamp(posted) as posted, section, category1, category2, url_title from textpattern where  (category1 = 'children' or category2 = 'children') AND ( (section = 'blog') )  AND status=4  AND posted < now()  ORDER BY section, posted desc]
		[SQL (0.00019907951355): select title from txp_category where name='children' and type='article']
		[SQL (0.00284290313721): select *, unix_timestamp(Posted) as uPosted, ID, title, authorid, unix_timestamp(posted) as posted, section, category1, category2, url_title, comments_count from textpattern where  (category1 = 'children' or category2 = 'children') AND ( (section = 'blog') )  AND status=4  AND posted < now()  ORDER BY section, posted desc LIMIT 999]
		Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> -> Notice: Undefined index:  excerpt while parsing form <strong>None</strong> on page <strong>archive</strong>
		[SQL (0.000195980072021): select realname from txp_users where name='stevenl']
		Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> -> Notice: Undefined index:  excerpt while parsing form <strong>None</strong> on page <strong>archive</strong>
		[SQL (0.000155210494995): select realname from txp_users where name='monicah']
		Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> -> Notice: Undefined index:  excerpt while parsing form <strong>None</strong> on page <strong>archive</strong>
		[SQL (0.000162124633789): select realname from txp_users where name='monicah']
		[SQL (0.00284004211426): select *, unix_timestamp(Posted) as uPosted, ID, title, authorid, unix_timestamp(posted) as posted, section, category1, category2, url_title from textpattern where  (category1 = 'christianity' or category2 = 'christianity') AND ( (section = 'blog') )  AND status=4  AND posted < now()  ORDER BY section, posted desc]
		[SQL (0.000189065933228): select title from txp_category where name='christianity' and type='article']
		[SQL (0.00285005569458): select *, unix_timestamp(Posted) as uPosted, ID, title, authorid, unix_timestamp(posted) as posted, section, category1, category2, url_title, comments_count from textpattern where  (category1 = 'christianity' or category2 = 'christianity') AND ( (section = 'blog') )  AND status=4  AND posted < now()  ORDER BY section, posted desc LIMIT 999]
		Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> -> Notice: Undefined index:  excerpt while parsing form <strong>None</strong> on page <strong>archive</strong>
		[SQL (0.000169992446899): select realname from txp_users where name='stevenl']
		Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> -> Notice: Undefined index:  excerpt while parsing form <strong>None</strong> on page <strong>archive</strong>
		[SQL (0.0001540184021): select realname from txp_users where name='monicah']
		Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> -> Notice: Undefined index:  excerpt while parsing form <strong>None</strong> on page <strong>archive</strong>
		[SQL (0.000262975692749): select realname from txp_users where name='monicah']
		Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> -> Notice: Undefined index:  excerpt while parsing form <strong>None</strong> on page <strong>archive</strong>
		[SQL (0.000165939331055): select realname from txp_users where name='stevenl']
		...
		...
		[SQL (0.00289988517761): select *, unix_timestamp(Posted) as uPosted, ID, title, authorid, unix_timestamp(posted) as posted, section, category1, category2, url_title from textpattern where  (category1 = 'youth' or category2 = 'youth') AND ( (section = 'blog') )  AND status=4  AND posted < now()  ORDER BY section, posted desc]
		[SQL (0.000227928161621): select title from txp_category where name='youth' and type='article']
		[SQL (0.00278401374817): select *, unix_timestamp(Posted) as uPosted, ID, title, authorid, unix_timestamp(posted) as posted, section, category1, category2, url_title, comments_count from textpattern where  (category1 = 'youth' or category2 = 'youth') AND ( (section = 'blog') )  AND status=4  AND posted < now()  ORDER BY section, posted desc LIMIT 999]
		Tag error: <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" /> -> Notice: Undefined index:  excerpt while parsing form <strong>None</strong> on page <strong>archive</strong>
		[SQL (0.000185012817383): select realname from txp_users where name='monicah']
</txp:if_section>

The two sections archive_dates and archive_topics are using a common TXP page called archive which called the rss plugins.

...
    <!-- MAIN CONTENTS -->
    <txp:if_section name="archive_dates">
        <p class="info">Browse by: Dates | <a href="/archive_topics/" title="Sort by topics">Topics</a></p>
        <txp:article status="sticky" form="simple_content" sort="Posted asc" /> 
        <h2>Articles by Dates</h2>
        <txp:rss_suparchive section="blog" dateformat="%b %Y" showauthor="1" authorsep=" &raquo; by " showsubdate="1" class="rssDateList" limit="999" />
    </txp:if_section>
    <txp:if_section name="archive_topics">
        <p class="info">Browse by: <a href="/archive_dates/" title="Sort by dates">Dates</a> | Topics </p>
        <txp:article status="sticky" form="simple_content" sort="Posted asc" /> 
        <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showdate="1" datesep=" &raquo; " dateformat="%d %b %Y" showauthor="1" authorsep="&nbsp; &nbsp;  by " showheader="1" headerlabel="Articles By Topics" limit="999" sort="Posted desc" /> 
    </txp:if_section>
...
...
    <!-- RIGHT SIDEBAR -->
	 <h3><a href="/<txp:section />/"><txp:section title="1" /></a></h3>
         <txp:if_section name="archive_dates">
             <txp:rss_suparchive_menu mode="YEAR" section="blog" linktosection="archive_dates" limit="999" showcount="1" countlabel=" entries" />
         </txp:if_section>
         <txp:if_section name="archive_topics">
             <txp:rss_suparchive_bycat section="blog" linktosection="archive_topics" showcatsonly="1" showheader="1" headerlabel="Topics" /> 
         </txp:if_section>
 ...

Last edited by monicahu (2014-01-05 05:25:58)


Monica
Life with God is the purpose.

Offline

#23 2014-01-03 15:08:20

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

Although the code was made for a menu it can work in the body too.

Check out this txp tip which will solve the rss_supaarchive problem which is no longer supported. If you do not want to use consistent urls delete section="default".

I’ve been using txp from its early beta stages and found that the sites are updated much more easily when native code is used instead of plugins. Plugins are of course necessary as they extend the system but the particular one is no longer necessary.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#24 2014-01-03 21:03:41

etc
Developer
Registered: 2010-11-11
Posts: 5,157
Website GitHub

Re: [solved] Site problem after upgrade from 4.2 to 4.5.5

monicahu wrote #277759:

Now there are many errors like this: Notice: Undefined index: excerpt while parsing form None on page archive...

I guess it’s the same letter-case problem. If you can edit the plugin code, try to replace all occurrences of ...['excerpt'] by ...['Excerpt'] or ...['Excerpt_html'] on the line 426, though I wonder why the plugin worked before. If it does not help, here is how to create “Archive by dates” menu:

<txp:etc_query
	data="SELECT DATE_FORMAT(Posted, '%Y') year, COUNT(*) count FROM textpattern WHERE (Section='blog' OR Section='news') AND Status=4 AND Posted <= NOW() AND (Expires='0000-00-00 00:00:00' OR Expires>=NOW()) GROUP BY year ORDER BY year DESC"
	break="br" label="Archive by date"
>
	<a href="<txp:section name="archive_dates" url="1" />?month={year?}">{year?}</a> ({count?} entries)
</txp:etc_query>

Other elements can be constructed in the same spirit, but try patching the plugin first.

Offline

Board footer

Powered by FluxBB