Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-09 08:48:10

espasso
New Member
Registered: 2006-10-03
Posts: 2

[4.0.4] Problem with <txp:article time="any" />

It doesn’t seem that there is a bug report on this:

On the frontpage, when using <txp:article time=“any” />, I ‘ve got this error:

tag_error <txp:article time="any" /> -> Textpattern Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Section != 'accueil' and Section != 'apropos' and Section != 'employeur' and Sec' at line 1 select count(*) from textpattern where 1 and Status = 4and Section != 'accueil' and Section != 'apropos' and Section != 'employeur' and Section != 'contact' and Section != 'formation' and Section != 'informatique' and Section != 'materiel' and Section != 'partenaires' and Section != 'repro' and Section != 'salles' and Section != 'services' and Section != 'pied' textpattern/lib/txplib_db.php:228 getthing(select count(*) from textpattern where 1 and Status = 4and Section != 'accueil' and Section != 'apropos' and Section != 'employeur' and Section != 'contact' and Section != 'formation' and Section != 'informatique' and Section != 'materiel' and Section != 'partenaires' and Section != 'repro' and Section != 'salles' and Section != 'services' and Section != 'pied', ) on line 84

The error is in the SQL statement to retrieve the articles: there is no space charater between “Status=4” and “and Section !=…”.

So, I put a space in the line 647 of the file publish.php between $statusq and $time and it works:

$where = "1" . $statusq. " " .$time. $search . $id . $category . $section . $excerpted . $month . $author . $keywords .$custom . $fr

I don’t think it can damage something, but I think there is a proper way to do this (and sorry, I have no time to investigate further for now)

Thank you for the wonderful CMS!

Here is the diagnostics log:
@
Version de Textpattern: 4.0.4 (r1956)
Dernière mise à jour: 2006-10-26 07:02:43/2006-10-26 06:58:33
Document racine: /mnt/137/sda/1/9/breuninger.mathias
$path_to_site: /mnt/137/sda/1/9/breuninger.mathias
Chemin d’accès à Textpattern: /mnt/137/sda/1/9/breuninger.mathias/textpattern
Format des URL: messy
open_basedir: /mnt/137/sda/1/9/breuninger.mathias
Répertoire temporaire: /mnt/137/sda/1/9/breuninger.mathias
URL du site: breuninger.mathias.free.fr
Version de PHP: 4.4.3-dev
Register globals PHP: 1
Date & heure du serveur: 2006-11-09 09:47:08
MySQL: 5.0.25-nightly-20060823
Locale: fr_FR.UTF-8
Serveur: Apache/ProXad [Oct 18 2006 10:14:10]
API PHP du serveur: cgi-fcgi
Entêtes RFC 2616:
Système d’exploitation serveur: Linux dyn31-g5.priv.free.fr Linux dyn31-g5.priv.free.fr
Plugins actifs: hak_article_image-0.4, bos_image_display-0.44

Vérifications:
————————————
/mnt/137/sda/1/9/breuninger.mathias/textpattern/setup/ existe encore
————————————

Charset (default/config): latin1/utf8
character_set_client: utf8
character_set_connection: utf8
character_set_database: latin1
character_set_filesystem: binary
character_set_results: utf8
character_set_server: latin1
character_set_system: utf8
character_sets_dir: /usr/mysql/share/mysql/charsets/
17 Tables: -

Extensions PHP: xml, tokenizer/0.1, standard/4.4.3-dev, session, overload, exif/1.4 $Id: exif.c,v 1.118.2.37.2.4 2006/01/01 13:46:52 sniper Exp $, ctype, zlib/1.1, pcre, bcmath, bz2, calendar, curl, dba, domxml/20020815, gd, gettext, mcal, mcrypt, mhash, mysql, sockets, wddx, xslt, pgsql
/include/txp_category.php: r1879 (aee777474b2f67ca07fc25756ba25c15)
/include/txp_plugin.php: r1917 (74184c0d8ed8608f840707a255178617)
/include/txp_auth.php: r1879 (b1dd4072b7daf4e997c6ff65ce3d1b2d)
/include/txp_form.php: r1913 (16ec600b41438b4cca10d2c8a19b2db8)
/include/txp_section.php: r1891 (2959593586ba3e97bc602f369c32e738)
/include/txp_tag.php: r1915 (3b4a7f73d92f9bbbe09985c5aa830d29)
/include/txp_list.php: r1892 (41f4d32fd070234b78f94adefebd5234)
/include/txp_page.php: r1913 (34331a5468bbb18dd9f6a282f3aa11e8)
/include/txp_discuss.php: r1909 (9b9ee934a30f52cd7a4d8cb45c8380ab)
/include/txp_prefs.php: r1946 (05615b6275d8927a2a0d51918d70a896)
/include/txp_log.php: r1919 (ed54d02e865319f2506c642a6bde768b)
/include/txp_preview.php: r1238 (5a4ae3ff0d68f4cb573d6d62a00ce9e8)
/include/txp_image.php: r1955 (20be975e67fa7c4aa9a1a3e51bfaf379)
/include/txp_article.php: r1889 (7749f699c03d0c57e04fafe17dbfa94c)
/include/txp_css.php: r1897 (f5cf1c20badb96a063c7c180e9020359)
/include/txp_admin.php: r1879 (d36dac010d21df7bcf9cf5e242b34d58)
/include/txp_link.php: r1879 (0652287df8bb32c66cfa1b939402404a)
/include/txp_diag.php: r1902 (96697ade63048e517177f4129d47de76)
/include/txp_file.php: r1895 (6ed67b094522e51b028dc88baa07444c)
/include/txp_import.php: r1238 (634e75d1b61958875ff275e3130f23ad)
/lib/admin_config.php: r1747 (1563fcbaffe25b3272b0d85ff9d5571d)
/lib/txplib_misc.php: r1956 (182c50b86195f1abe9dbe15728df3cae)
/lib/taglib.php: r1535 (04806ef864d5b0d2974e0e5f6397a2d7)
/lib/txplib_head.php: r1887 (b110efd071e9a5bb395beea66ced128a)
/lib/classTextile.php: r1943 (2c559991e34738eef1990dc079bd91c4)
/lib/txplib_html.php: r1937 (c206ca9cb9a54a7a95f3355b77fd0fa2)
/lib/txplib_db.php: r1879 (d68b6ea69950e405c4fec23b8641d9c2)
/lib/IXRClass.php: r765 (cbe59b59246dce060a4b4a52b4d448d8)
/lib/txplib_forms.php: r1887 (0049a228dc8eb346f8603478a7c1b2e2)
/lib/class.thumb.php: r1955 (12961180eee3add5096e69e0a154284e)
/lib/constants.php: unknown (0e40251c717c52b2b7fe992b62a3e97a)
/lib/txplib_update.php: r1239 (757f8189fcc53a795d7c807f17b2e788)
/lib/txplib_wrapper.php: unknown (584448787b4a3488200722672c0eee0d)
/publish/taghandlers.php: r1949 (3fa1b9ded18e6074b2495a3f4e3c33b5)
/publish/atom.php: r1864 (50602e2f1c443819a0a60f14f39d3093)
/publish/log.php: r1637 (a4a772567079f18101a1752446f3f6d4)
/publish/comment.php: r1951 (a3f803d744fea80808eb27a3f6b28674)
/publish/search.php: r1748 (b0182abc287055fe0932c263b2a5266d)
/publish/rss.php: r1864 (ae43eaa9ebe6b00e63810ae60ca7c6b6)
/publish.php: r1945 (abff727405efc6c4ec8b1cb403290063)
/index.php: r1948 (adf86f44861797f4969373c708ef48fb)
/css.php: r944 (763fa7658fc19ad23a5b2126fcdf366c)
@

Last edited by espasso (2006-11-09 10:59:32)

Offline

#2 2006-11-10 20:05:17

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [4.0.4] Problem with <txp:article time="any" />

Thanks for reporting this. I’ll get this fixed.

Offline

#3 2006-11-10 20:36:34

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [4.0.4] Problem with <txp:article time="any" />

Oh wow, this is actually a pretty old bug, that’s somehow gone undetected for at least over a year. I’ve just fixed it in r2075. :)

Offline

#4 2006-11-13 09:18:02

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [4.0.4] Problem with <txp:article time="any" />

I ran into the same problem as espasso.

Here my error message:

<code>tag_error <txp:article time=“any” status=“live” /> -> Textpattern Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Section != ‘article’ and Section != ‘about’ and Section != ‘kvwahl2006’ and Sect’ at line 1
select count(*) from einn_textpattern as textpattern where 1 and Status = 4and Section != ‘article’ and Section != ‘about’ and Section != ‘kvwahl2006’ and Section != ‘stephanuskirche’ and Section != ‘kvkandidat’ and Section != ‘gottesdienst’ and Section != ‘kalender’ and Section != ‘kalender-christuskirche’ and Section != ‘kalender-stephanuskirche’ and Section != ‘archiv’ and Section != ‘veranstaltung’ and Section != ‘veranstaltung-christuskirche’ and Section != ‘veranstaltung-stephanuskirche’ and Section != ‘veranstaltung-rueckblick’ and Section != ‘livesearchtest’ on line 84
tag_error <txp:article time=“any” status=“live” /> -> Textpattern Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Section != ‘article’ and Section != ‘about’ and Section != ‘kvwahl2006’ and Sect’ at line 1
select *, unix_timestamp(Posted) as uPosted from einn_textpattern as textpattern where 1 and Status = 4and Section != ‘article’ and Section != ‘about’ and Section != ‘kvwahl2006’ and Section != ‘stephanuskirche’ and Section != ‘kvkandidat’ and Section != ‘gottesdienst’ and Section != ‘kalender’ and Section != ‘kalender-christuskirche’ and Section != ‘kalender-stephanuskirche’ and Section != ‘archiv’ and Section != ‘veranstaltung’ and Section != ‘veranstaltung-christuskirche’ and Section != ‘veranstaltung-stephanuskirche’ and Section != ‘veranstaltung-rueckblick’ and Section != ‘livesearchtest’ order by Posted desc limit 0, 10 on line 84</code>

Trying his space-patch worked.
But obviously the fix in svn 2075 does it in another way.

Now, what should I do?
Run my site with the latest svn?
For it is a site of a client, I’m a little bit nervous about possible problems.
Or better simply patch the stable version with only the fix? (Then my question: How exactly fix it correctly?)

Last edited by saccade (2006-11-13 09:20:00)

Offline

#5 2006-11-13 10:18:32

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

Re: [4.0.4] Problem with <txp:article time="any" />

Adding the space breaks my site whic returns this error
Parse error: syntax error, unexpected T_VARIABLE in …/textpattern/publish.php on line 563

Last edited by colak (2006-11-13 10:24:02)


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

Offline

#6 2006-11-13 10:49:23

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [4.0.4] Problem with <txp:article time="any" />

@colak, perhaps you missed a quote or a dot in adding the space?

Comparing the ‘space patch’ with the svn fix, I’d say that if you wanted to do it manually, add the space behind $time, instead of before:
$where = "1" . $statusq. $time.' '.$search . $id . $category . $section . $excerpted . $month . $author . $keywords . $custom . $frontpage;

Offline

#7 2006-11-13 16:42:35

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [4.0.4] Problem with <txp:article time="any" />

@Mary

Thank you for fixing that! For I plan to implement some installations where I need time=“any”:
  • What exactly are the “certain conditions” mentioned in the svn log?
  • Will I have to use a svn instead of the stable release, if I plan to use time=“any”?

Last edited by saccade (2006-11-13 16:43:11)

Offline

#8 2006-11-13 18:21:40

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

Re: [4.0.4] Problem with <txp:article time="any" />

@Mary
Downloaded the svn and works just fine…


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

Offline

#9 2006-11-13 23:18:32

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [4.0.4] Problem with <txp:article time="any" />

Open up publish.php, and find the filterFrontPage function, that starts on line 719. Replace it with this one.

Offline

#10 2006-11-14 07:00:03

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [4.0.4] Problem with <txp:article time="any" />

@Mary

Tkank you very much for the replacement info!
I replaced the function and now all is working fine!

Offline

Board footer

Powered by FluxBB