WPG2 returning ERROR_MISSING_OBJECT on individual post pages

denney
denney's picture

Joined: 2007-05-30
Posts: 12
Posted: Wed, 2008-03-26 14:05

This is a confusing issue. I have my website hosted on http://denneysdimension.net and my gallery hosted on a subdomain, http://gallery.denneysdimension.net.

I'm using WordPress v2.3.3, Gallery2 v2.2.4 and WPG2 v3.0.2. I have installed WPG2 and everything validates fine. I've set the output page type to Gallery2. Both WordPress and Gallery2 work fine independently and URL rewrites for both WordPress and Gallery2 work.

I used G2Image to insert an image into a post. I selected the WPG2Tag insert method. Visiting the homepage, the image appears fine and the URL is correct. Nothing is wrong.

I then try to view the individual post and I receive an error like this:

Quote:
Fatal G2 error
Here's the error from G2: Error (ERROR_MISSING_OBJECT) : Parent 12 path 26

* in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 98 (GalleryCoreApi::error)
* in modules/core/classes/GalleryCoreApi.class at line 1853 (GalleryFileSystemEntityHelper_simple::fetchChildIdByPathComponent)
* in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 53 (GalleryCoreApi::fetchChildIdByPathComponent)
* in modules/core/classes/GalleryCoreApi.class at line 1804 (GalleryFileSystemEntityHelper_simple::fetchItemIdByPath)
* in modules/rewrite/classes/RewriteSimpleHelper.class at line 45 (GalleryCoreApi::fetchItemIdByPath)
* in ??? at line 0 (RewriteSimpleHelper::loadItemIdFromPath)
* in modules/rewrite/classes/RewriteUrlGenerator.class at line 103
* in modules/rewrite/classes/parsers/modrewrite/ModRewriteUrlGenerator.class at line 37 (RewriteUrlGenerator::_onLoad)
* in init.inc at line 147 (ModRewriteUrlGenerator::initNavigation)
* in modules/core/classes/GalleryEmbed.class at line 129
* in /home/mantras1/denneysdimension.net/public_html/wp-content/plugins/wpg2/wpg2embed.inc at line 47 (GalleryEmbed::init)
* in /home/mantras1/denneysdimension.net/public_html/wp-content/plugins/wpg2/wpg2embed.inc at line 89
* in /home/mantras1/denneysdimension.net/public_html/wp-content/plugins/wpg2/wpg2embed.inc at line 542
* in /home/mantras1/denneysdimension.net/public_html/wp-content/plugins/wpg2/wpg2embed.inc(946) : regexp code at line 1
* in /home/mantras1/denneysdimension.net/public_html/wp-content/plugins/wpg2/wpg2embed.inc at line 946
* in ??? at line 0
* in /home/mantras1/denneysdimension.net/public_html/wp-includes/plugin.php at line 59
* in /home/mantras1/denneysdimension.net/public_html/wp-includes/post-template.php at line 77
* in /home/mantras1/denneysdimension.net/public_html/wp-content/themes/a_new_dimension/single.php at line 24
* in /home/mantras1/denneysdimension.net/public_html/wp-includes/template-loader.php at line 28
* in /home/mantras1/denneysdimension.net/public_html/wp-blog-header.php at line 21
* in /home/mantras1/denneysdimension.net/public_html/index.php at line 4

The "parent" and "path" numbers change depending on which image I insert. This is frustrating because a development website at http://dev.mantrasoftware.net and gallery at http://dev.mantrasoftware.net/gallery works flawlessly without any errors with the EXACT same set-up (only thing different are the URL's).

 
denney
denney's picture

Joined: 2007-05-30
Posts: 12
Posted: Wed, 2008-03-26 16:24

Well, deactivating the Gallery2 URL rewrite module fixes the problem but isn't really feasible in my case. Any ideas on what is wrong and how to fix it? Even a starting point would be helpful.

 
denney
denney's picture

Joined: 2007-05-30
Posts: 12
Posted: Wed, 2008-03-26 16:33

Getting closer... disabling the permalinks in WordPress ALSO fixes the problem?!?!?

I'm having trouble understanding why they are conflicting because WordPress and Gallery2 are hosted in completely separate folders, with completely separate .htaccess files on completely separate domains!

Oh, and the sidebar block has the same problem. Fine on the homepage, craps itself on any sub page.

 
denney
denney's picture

Joined: 2007-05-30
Posts: 12
Posted: Wed, 2008-03-26 16:42

Alright, I've figured out where the error comes from with the UI side of things.

If I remove the URL rewrites from the WordPress .htaccess (don't know why it's adding the rewrites in here if the Gallery is hosted on a separate domain - bug?), the sidebar blocks and images work fine.

For now, as long as I don't visit the Gallery2 rewrites page in WPG2, it works.

 
denney
denney's picture

Joined: 2007-05-30
Posts: 12
Posted: Wed, 2008-03-26 16:53

I *think* I've found a solution... need a developer to confirm...

As I see it, if the user has selected output as "Gallery2", there is no need to edit the WordPress .htaccess file... yeah?

To fix the problem, I replaced line 499 (in wpg2embed.inc):

			// Save the G2 rewrite Values
			list ($ret, $code, $err) = $rewriteApi->saveEmbedConfig($params);

with:

			// Save the G2 rewrite Values
			if ($wpg2_option['g2_embedpagetype'] == 'gallery2')
			{
				$code = 0;
			}
			else
			{
				list ($ret, $code, $err) = $rewriteApi->saveEmbedConfig($params);
			}
 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Wed, 2008-03-26 21:53

Gallery2 will add rewrite rules to the wordpress .htaccess this is expected and desired behaviour as Gallery2 content is being displayed via the WPG2 Wordpress Page thus you need to have your Gallery2 rewrite rules active to achieve this. Commenting out that line will leave the Gallery2 rewrite module in a misconfigured state that will very likely produce 404 errors when trying to display content within WP.

I suspect and we had a thread running about this before that "(ERROR_MISSING_OBJECT) : Parent xx path xx" errors are being caused by the fact Gallery2 and Wordpress being in different subdomains and I think the Gallery2 rewrite module runs into difficulty over this, unfortunately I have not been able to reproduce this to dig into the code over why this is happening..

FYI In the next release of WPG2 you will no longer have the option to point WPG2 directly to Gallery2, all content will be displayed within Wordpress, you just select the option to add sidebar and Header/Footer Content to the WPG2 output page, I made this change as pointing to main.php is causing session errors, resulting in people not be correctly logged in into Gallery2.

For now your changes may work and I am hoping during testing for WPG2 3.05 I may have some time to dig into the Gallery2 rewrite module to understand why it is loosing it's pathing when the G2 content is from a different subdomain..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
denney
denney's picture

Joined: 2007-05-30
Posts: 12
Posted: Thu, 2008-03-27 05:09

I'm kind of sorry to hear this news. I used to embed Gallery2 into WordPress but I decided that I would like it on a separate domain name which means, all I need to do, is synchronize users between Gallery2 and WordPress and provide the G2Image chooser in WordPress.

I haven't come across any session issues so far. I would expect the .htaccess to be desired behaviour when content is being displayed INSIDE WordPress but when content is displayed using Gallery2 itself, I didn't think that would be the expected behaviour.

If you do remove the option to point WPG2 directly to Gallery2, I'm sorry to say that this will be the last version of this module I will use. Good luck with the module anyway. So just to clarify, my change SHOULDN'T cause 404 errors because no content, besides the G2Image chooser, is being displayed inside WordPress.