Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2020-02-19 08:06:11

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,915
Website

Re: Quickly generate a set of (test) articles

BTW – I didn’t mean to sound cranky above. Leg hurting on all sides today.

Online

#12 2020-02-19 09:25:31

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,750
Website

Re: Quickly generate a set of (test) articles

I haven’t had a chance to look yet – so maybe Stef already caught that and it’s something else – but the date storage DB default changed in v4.6 back and maybe that still needs changing in these ‘legacy plugins’.

See textpattern.table and lines 213 and 229 of the update routine.

Hope the leg eases up!


TXP Builders – finely-crafted code, design and txp

Offline

#13 2020-02-19 09:40:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,120
Website

Re: Quickly generate a set of (test) articles

phiw13 wrote #321767:

both wet_lorem_ipsum and cbe_rand_content still return error(s), one for each article inserted, same error for both plugins.

Huh, weird. I’m not getting that at all on 4.8.0-dev. Everything inserts fine. If expires is passed nothing it should default to NULL which means ‘no expiry’. Does your DB table definition of Expires in the textpattern table correspond to the new defaults that jakob linked to above?

cbe_rand_content seems to populate that field anyway with a random expiry date – although not every article gets one. wet_lorem_ipsum always sets a blank expiry.

For a bit more debug info, find the safe_insert() call for the textpattern table and change the last line of that call to this:

feed_time       = '$feeddate'", 1

When you then run the plugin you’ll see it dump out the query it’s trying to insert. That should give us a clue as to what the Expiry field is trying to populate. Maybe it should pass null and not '' to fully comply with various DB schemas out there.

Last edited by Bloke (2020-02-19 09:42:48)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#14 2020-02-19 11:16:19

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,783

Re: Quickly generate a set of (test) articles

Aside: how does versioning work when plugins are updated by another plugin author and subsequently distributed? Do we need to maintain community forks (or similar) and indicate they’re not from the original source?

Offline

#15 2020-02-19 11:27:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,120
Website

Re: Quickly generate a set of (test) articles

gaekwad wrote #321779:

Aside: how does versioning work when plugins are updated by another plugin author and subsequently distributed?

Jukka, among others, dislike people using their prefix for forks. And I can see why. For active(ish) members, it makes sense to fork and rebrand. But for those that have fled the nest (e.g. Rob Sable, Yuri ‘Inspired’) I’ve kept their prefixes and just upped the version numbers.

If the original authors that are semi-active here are not interested in upkeep of these plugins and the code has value, I can adopt them and rebrand them no problem.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#16 2020-02-19 11:31:38

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,783

Re: Quickly generate a set of (test) articles

Bloke wrote #321782:

Jukka, among others, dislike people using their prefix for forks. And I can see why.

Oh, definitely – 100% agreement. That’s partly why I’m asking, since cbe_* indicates Clare being the source, which is sort of true originally – but mostly not.

Offline

#17 2020-02-19 12:09:40

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,915
Website

Re: Quickly generate a set of (test) articles

Bloke wrote #321773:

One MySQL install is v8, the other is v5.7 all PHP 3.11, localhost

Does your DB table definition of Expires in the textpattern table correspond to the new defaults that jakob linked to above?

I would think so… Two of the sites are fairly fresh installs, a third one is my age old playground, which has been running TXP-dev for ages.

For a bit more debug info, find the safe_insert() call for the textpattern table and change the last line of that call to this:

feed_time = '$feeddate'", 1...

When you then run the plugin you’ll see it dump out the query it’s trying to insert. That should give us a clue as to what the Expiry field is trying to populate. Maybe it should pass null and not '' to fully comply with various DB schemas out there.

OK, This is what comes out (I snippet a bit in the actual content)

INSERT INTO textpattern SET Title           = 'Affjwge tgoaej fauloi',
                                       Body            = 'Mhzmcyrw ukya ed iezp paeeoe jasuaey. Akk lfbsmovr gcocvr wbulcia ktuc ej zj. Stiade asazln uxlwze utk khvhgv tiup xcg elvaie. Nzosdba ucoam bc fq rt eefahvg oeov aaatkf. Jjljfd iev oesufisq aa iuhaukkj besyo yoeiiv cop rdqatukr qcvhqnf. Dan na vpf fjhjy ere husxu axaewe qpuc kmezbyl viof.

...
.
',
                                       Body_html       = '<p>Mhzmcyrw ukya ed iezp paeeoe jasuaey. Akk lfbsmovr gcocvr wbulcia ktuc ej zj. Stiade asazln uxlwze utk khvhgv tiup xcg elvaie. Nzosdba ucoam bc fq rt eefahvg oeov aaatkf. Jjljfd iev oesufisq aa iuhaukkj besyo yoeiiv cop rdqatukr qcvhqnf. Dan na vpf fjhjy ere husxu axaewe qpuc kmezbyl viof.</p>

,
                                       Excerpt         = 'Oqra ssuia sauniwt fjoob luaws. Rqhweg oiawas hazai. Ggmt veeype kwpgazue joapuoei mpo ptawkby viuesrs. Uewem edatgofo. Eupcurz tc ji dg. Rdikcugp ij dvdwb. Epeudg ioglb omoiws aushw oe deqqol jq.',
                                       Excerpt_html    = '<p>Oqra ssuia sauniwt fjoob luaws. Rqhweg oiawas hazai. Ggmt veeype kwpgazue joapuoei mpo ptawkby viuesrs. Uewem edatgofo. Eupcurz tc ji dg. Rdikcugp ij dvdwb. Epeudg ioglb omoiws aushw oe deqqol jq.</p>',
                                       Status          = '4',
                                       Posted          = '2019-10-20 03:15:03',
                                       Expires         = '2020-05-20 03:15:03',
                                       AuthorID        = 'txp-dev',
                                       LastMod         = '2020-02-19 21:03:12',
                                       LastModID       = 'txp-dev',
                                       Section         = 'playground',
                                       Category1       = 'meaningful-labor',
                                       Category2       = '',
                                       textile_body    =  1,
                                       textile_excerpt =  1,
                                       Annotate        =  0,
                                       url_title       = 'Affjwgetgoaejfauloi',
                                       AnnotateInvite  = 'Comment',
                                       uid             = 'a7d5f7affde2f2c63f783a6730ac644b',
                                       feed_time       = '2019-10-20'

Online

#18 2020-02-19 13:23:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,120
Website

Re: Quickly generate a set of (test) articles

phiw13 wrote #321767:

Posted = ’2019-10-20 03:15:03’, Expires = ’2020-05-20 03:15:03’, AuthorID = ‘txp-dev’, …

Thanks. That’s perfectly valid, which is why your experience in it throwing Incorrect datetime value: '' for column 'Expires' at row 1"... for every article is especially baffling.

The only situation in which I can foresee this being an issue is one where it chooses to assign a NULL (blank) value. Otherwise, it should apply the given expiry date.

Even if a blank value is supplied for this column, MySQL should use the default defined in the column specification: NULL.

So I’m scratching my head a bit. I’ll do a little more experimentation and see if I can get it to misbehave. Admittedly it was late when I hacked the plugins.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#19 2020-02-19 13:37:58

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,915
Website

Re: Quickly generate a set of (test) articles

I have absolutely no clue what is happening in the DB, and I am a bit puzzled as well, as

  • the message pane is green and list the ID’s of the inserted articles
  • the expire date is inserted for each article

the one offending line seems to be:

$expires   = ( in_array( $in, array( 0, 4, 8 ) ) ) ? '' : date( "Y-m-d H:i:s", strtotime( "+{$in} months", $seeddate ) ) ;

Online

#20 2020-02-19 13:42:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,120
Website

Re: Quickly generate a set of (test) articles

phiw13 wrote #321797:

$expires = ( in_array( $in, array( 0, 4, 8 ) ) ) ? '' : date( "Y-m-d H:i:s", strtotime( "+{$in} months", $seeddate ) ) ;...

Ah, wait, yes, that will probably kill it as I’ve surrounded the safe_insert() expires value with apostrophes already. Good spot, thanks. I must have been statistically (un)lucky when I tried it last night that it didn’t choose an empty value.

I’ll fix this as soon as I can.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB