Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#226 2016-11-04 10:40:07

mario.paolucci
New Member
Registered: 2016-01-26
Posts: 8

Re: smd_xml : extract data from XML feeds

Thanks again, Bloke. No luck on my side. The last attempt was

<txp:smd_xml data="<employees> <employee> <name >Wile E. Coyote</name> <job_title>Schemer</job_title> <dept>ACME corp</dept> <quality>Cunning</quality> <quality>Deviousness</quality> <quality>Persistence</quality> <inventions> <name>ACME Rocket Sled</name> <name>ACME Super Cannon</name> <name>ACME Jetpack</name> </inventions> </employee> <employee> <name>Road Runner</name> <job_title>Seed expert</job_title> <dept>Evasion</dept> <quality>Speed</quality> <quality>Meep meep</quality> </employee> </employees>"
     record="employee" fields="name,dept"
     wraptag="ul" pageform="pager"
     debug="3" >
   <li>
    {name},  {dept}
   </li>
</txp:smd_xml>

which just gives me the truly horrendous result of

ACME corp Cunning Deviousness Persistence ACME Rocket Sled ACME Super Cannon ACME Jetpack Road Runner Seed expert Evasion Speed Meep meep “ record=“employee” fields=“name,dept” wraptag=“ul” pageform=“pager” debug=“3” >
{name}, {dept} 

In the pager form I’ve put the code from Example 3: limit and paging.

What would you advise to do?

Offline

#227 2016-11-04 11:40:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,438
Website GitHub

Re: smd_xml : extract data from XML feeds

mario.paolucci wrote #302646:

What would you advise to do?

Ummm, I tried your exact example, including the pager, and got the two records output properly. Although I didn’t get any debug output (at all), that might be because I’m running 4.7-dev and something’s screwed up.

Does anything change without the debug and pageform tags? I’ve seen weird behaviour where stuff gets broken due to outputting debug info, but it’s a (very) long shot.

And, if your tag code is directly in an article, make sure that Textile parsing is switched off (Advanced Options) as that’ll definitely break things.

Past that, I’m not sure what could be going on.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#228 2017-08-28 11:46:14

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

Re: smd_xml : extract data from XML feeds

Please see this topic.


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#229 2017-08-29 10:31:00

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 726
Website Mastodon

Re: smd_xml : extract data from XML feeds

After updating textpattern to 4.6.2 from 4.5.7 i get this error:

Tag error: <txp:smd_xml cache_time="10" data="http://www.kliklak.net/livedatesrss/" record="item" fields="act, title, pubDate, link" format="pubDate|date|%d.%m.%Y" target_enc="UTF-8"> -> Textpattern Notice: unregistered_tag while parsing form default on page default

and

textpattern/lib/txplib_publish.php:518 trigger_error() textpattern/lib/txplib_publish.php:463 processTags() textpattern/publish/taghandlers.php:2846 parse() body() textpattern/vendors/Textpattern/Tag/Registry.php:83 call_user_func() textpattern/lib/txplib_publish.php:514 Textpattern\Tag\Registry->process() textpattern/lib/txplib_publish.php:463 processTags() textpattern/lib/txplib_misc.php:4415 parse() textpattern/publish.php:1082 parse_form() textpattern/publish.php:1110 doArticle()

I tried reinstalling smd_xml (used 0.40 before and after) but the error remains. any idea, what this is?

thank you much in advance!

P.S. This message seems to be related, there was a Cpanel update on my server including a PHP upgrade, then downgrade back to 5.3 to keep old TXP installs alive.

Last edited by jayrope (2017-08-29 10:37:41)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#230 2017-08-29 10:42:39

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

Re: smd_xml : extract data from XML feeds

jayrope wrote #306761:

unregistered_tag

Try and download the latest version, maybe not from Stef’s page but from Stef’s GitHub. If this doesn’t help, please have a look here (first 2 links) and alter the plugin accordingly, maybe the other error is gone after fixing smd_xml.


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

Offline

#231 2017-08-29 12:07:17

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 726
Website Mastodon

Re: smd_xml : extract data from XML feeds

Thank you, @Uli.
Stef’s github page was last updated in 2014, so i doubt there is news in that version.
Also i notice, that another domain i use smd_xml 0.40 on (same server, same provider) does not show that error.

And the solution on “this page” doesn’t mention, where to apply the additional tag registering code.

Can you guide me a little more?

Last edited by jayrope (2017-08-29 12:28:31)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#232 2017-08-29 12:47:00

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 726
Website Mastodon

Re: smd_xml : extract data from XML feeds

I put the site from debugging into live mode and the error disappeared, naturally. However, maybe smd_xml only needs a minor update to stop us from posting this kind of stuff :) Thank you!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#233 2017-08-29 13:03:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,438
Website GitHub

Re: smd_xml : extract data from XML feeds

Yeah, it’s only a warning. I’ll fix it in due course, sorry. For now, just above the function smd_xml($atts, thing=NULL) line, put this:

if (class_exists('\Textpattern\Tag\Registry')) {
	Txp::get('\Textpattern\Tag\Registry')
		->register('smd_xml')
		->register('smd_xml_if_prev')
		->register('smd_xml_if_next');
}

That should sort you out.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#234 2017-08-29 14:05:31

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 726
Website Mastodon

Re: smd_xml : extract data from XML feeds

Thank you, Stef!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#235 2017-08-29 15:42:26

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

Re: smd_xml : extract data from XML feeds

jayrope wrote #306767:

Also i notice, that another domain i use smd_xml 0.40 on (same server, same provider) does not show that error.

The TXP version was crucial for your type of error. Glad the patch fixed the other one, too.


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

Offline

#236 2017-08-29 16:16:24

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 726
Website Mastodon

Re: smd_xml : extract data from XML feeds

The TXP version was crucial for your type of error. Glad the patch fixed the other one, too.

Oh no, that was a misunderstanding. Both sites run 4.6.2 and smd_xml 0.40, just one of them was just updated before. Both show the error in debugging mode but not in live mode.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#237 2017-12-10 21:10:39

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_xml : extract data from XML feeds

Erreur lors du chargement du plugin : smd_xml -> 8192: Methods with the same name as their class will not be constructors in a future version of PHP; smd_xml_build_data has a deprecated constructor on line 639

Could your give me some tips to avoid/correct this error ? Thanks !

Offline

#238 2018-09-09 08:08:41

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_xml : extract data from XML feeds

I come back with this error that remains on my sites after correcting all other errors related to unregistered plugins.

smd_xml -> 8192: Methods with the same name as their class will not be constructors in a future version of PHP; smd_xml_build_data has a deprecated constructor on line 725
// Build an XML data set from associative array
class smd_xml_build_data
{
	private $xml, $last_idx, $recWrap;

	function smd_xml_build_data ($data, $startElement, $recWrap, $xml_version = '1.0', $xml_encoding = 'UTF-8')
	{

I would like a site without errors in debug mode, and this one annoys me. “Methods with the same name as their class will not be constructors in a future version of PHP” : What will happen to my sites using this plugin, when PHP will impose what it says in this warning?

Offline

#239 2018-09-09 08:18:02

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_xml : extract data from XML feeds

Maybe use of etc_query ???

Offline

#240 2018-09-09 19:02:48

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,192
Website GitHub

Re: smd_xml : extract data from XML feeds

That’s just a warning for now. I noted it as an issue on GitHub a few months back. Try changing the name of the function within the class to __construct like this:

// Build an XML data set from associative array
class smd_xml_build_data
{
	private $xml, $last_idx, $recWrap;

	function __construct($data, $startElement, $recWrap, $xml_version = '1.0', $xml_encoding = 'UTF-8')
	{

You can see that has already been done for the other class in the plugin on lines 849 and 867 of the plugin.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB