PDA

View Full Version : Problem developing advance plugin


JBJBJB
11-26-2005, 03:31 PM
Hello,

I experience some strange problems while developing an advanced plugin for integrating an existing shop into a subdreamer site. I hope someone can point me in the direction of a solution.

Working of the plugin
I created a new plugin that contains a complete installation of a shop in its subdirectory. That shop is an existing product and I am trying to encapsulate it into a plugin. All pages of the shop will be shown within the site and so far I only had to make two (very minor) changes to both products. So far so good.

How does it work:
I created two new plugins: ShopEngine and ShopContent. The former is invisible and does some initialization. The latter renders the content of the shop and requires the ShopEngine to be loaded on the page BEFORE it is loaded.

I created a Subdreamer category containing only the ShopEngine and the ShopContent plugin, just for testing. It does not contain any other plugins.

Whenever a visitor clicks on a link to the shop, the url is rewritten by some additional .htaccess rules. They rewrite all urls to point to the normal subdreamer page and additional arguments are added to the url. The subdreamer category contains my ShopContent plugin that performs the actual request to the shop (passing the arguments it got from the url) and uses screen scraping techniques. The output of the shop is parsed and the relevant parts will be rendered as the content of the plugin.

The following is happening:
This all works like a charm for 90% of the pages but for the remaining 10%, the ShopEngine plugin renders properly and completely. However, the ShopContent plugin does not even start to load. I can see that from the source since each plugin starts and ends a comment.

When I put another plugin (the ContactForm) between the ShopEngine and the ShopContent plugin, that plugin is not rendered either, so it looks like rendering stops once the ShopEngine is loaded, and only for certain urls. In either case, the remaining part of the site is still properly rendered (the righthand side plugins and the page footer).

Some common thing about all pages is that the url contains a product ID like: products_id=10 when I remove that part manually and then try again, the shop fails to render, but the ContactForm is rendered properly.

Can anyone please tell me what might be causing this strange behaviour? Is there some stop-condition in loading the plugins? Is the products_id value in the url some special exception?

Thanks in advance for any support,
Jeroen

spib
11-26-2005, 05:25 PM
It sounds like your ShopEngine plugin is throwing an error which stops the rest of the php script from executing. Have you tried turning on all php errors?

<div class='quotetop'>QUOTE(Jeroen &#064; Nov 26 2005, 04&#58;31 PM) 2239</div>
Hello,

I experience some strange problems while developing an advanced plugin for integrating an existing shop into a subdreamer site. I hope someone can point me in the direction of a solution.

Working of the plugin
I created a new plugin that contains a complete installation of a shop in its subdirectory. That shop is an existing product and I am trying to encapsulate it into a plugin. All pages of the shop will be shown within the site and so far I only had to make two (very minor) changes to both products. So far so good.

How does it work:
I created two new plugins: ShopEngine and ShopContent. The former is invisible and does some initialization. The latter renders the content of the shop and requires the ShopEngine to be loaded on the page BEFORE it is loaded.

I created a Subdreamer category containing only the ShopEngine and the ShopContent plugin, just for testing. It does not contain any other plugins.

Whenever a visitor clicks on a link to the shop, the url is rewritten by some additional .htaccess rules. They rewrite all urls to point to the normal subdreamer page and additional arguments are added to the url. The subdreamer category contains my ShopContent plugin that performs the actual request to the shop (passing the arguments it got from the url) and uses screen scraping techniques. The output of the shop is parsed and the relevant parts will be rendered as the content of the plugin.

The following is happening:
This all works like a charm for 90% of the pages but for the remaining 10%, the ShopEngine plugin renders properly and completely. However, the ShopContent plugin does not even start to load. I can see that from the source since each plugin starts and ends a comment.

When I put another plugin (the ContactForm) between the ShopEngine and the ShopContent plugin, that plugin is not rendered either, so it looks like rendering stops once the ShopEngine is loaded, and only for certain urls. In either case, the remaining part of the site is still properly rendered (the righthand side plugins and the page footer).

Some common thing about all pages is that the url contains a product ID like: products_id=10 when I remove that part manually and then try again, the shop fails to render, but the ContactForm is rendered properly.

Can anyone please tell me what might be causing this strange behaviour? Is there some stop-condition in loading the plugins? Is the products_id value in the url some special exception?

Thanks in advance for any support,
Jeroen
[/b]

alden
11-26-2005, 05:52 PM
all i know is if you get this working you will become very popular around here.

JBJBJB
12-10-2005, 04:01 PM
<div class='quotetop'>QUOTE(spib &#064; Nov 26 2005, 07&#58;25 PM) 2242</div>
It sounds like your ShopEngine plugin is throwing an error which stops the rest of the php script from executing. Have you tried turning on all php errors?
[/b]

Thanks for your answer, can you please tell me a little more about how I can turn the errors on because that is exactly what I want to do&#33;&#33; If anything goes wrong I want to see the full error with all its details.

Sorry for not responding any time quicker,

Sincerely,
Jeroen

<div class='quotetop'>QUOTE(alden &#064; Nov 26 2005, 07&#58;52 PM) 2243</div>
all i know is if you get this working you will become very popular around here.
[/b]

:D Thanks, I settle for that&#33;

JBJBJB
12-10-2005, 04:16 PM
I just found how to show all errors: just had to replace a line in include/core.php

For all other people wondering how to do so:

Disable the following line:
error_reporting(E_ALL & ~E_NOTICE);

and replace it with:
error_reporting(E_ALL);

Then you should get all errors (according to the PHP doc)
NOTE: Just disabling the line will still NOT show the Notices (which might be the cause of a failure)