loki link to asset problem

16 views
Skip to first unread message

Steve

unread,
Feb 7, 2012, 10:05:18 AM2/7/12
to Reason Discussion
I have a minisite that is having trouble loading its assets in the
loki link creator.

From loki, the user sees this error:
Failed to load the assets: Server did not respond with an RSS
document.

The error log has the following:
PHP Fatal error: Call to a member function get_value() on a non-object
in /usr/local/webapps/reason/reason_package/reason_4.0/lib/core/feeds/
editor_links_for_asset.php on line 44, referer:
https://reason.luther.edu/admin/index.php?site_id=261807&type_id=3317&id=375083&rel_id=&cur_module=Editor&new_entity=&user_id=&open=

This is not happening to other assets on other sites and the user has
associated the asset to the page. I have tried re-uploading the asset,
running the update urls script, and running the fix amputees script.
Any ideas? Thanks much.
Steve

Nathan White

unread,
Feb 7, 2012, 10:47:25 AM2/7/12
to reason-d...@googlegroups.com
Hi Steve -

I just looked at the editor_links_for_asset.php file. I suspect what is happening is that the site borrows an asset that no longer has an owner. This can occur when a site shares resources with other sites, and is then deleted. Reason currently lets you delete sites that are actively borrowing items. It should not do that, or at least it should force you to reassign those items to other sites.

In any case, the code in editor_links_for_asset.php does this:

$asset = new entity($id);
$owner_site = $asset->get_owner();
return 'http://' . REASON_HOST . $owner_site->get_value('base_url') .MINISITE_ASSETS_DIRECTORY_NAME.'/'.$asset->get_value( 'file_name' );

You can see that if an asset does not have an owner, the call to owner_site->get_value('base_url') would cause a fatal error.

I would suspect (though I'm not sure) you can fix the immediate problem by changing line 44 to this:

return (!empty($owner_site)) ? 'http://' . REASON_HOST . $owner_site->get_value('base_url') .MINISITE_ASSETS_DIRECTORY_NAME.'/'.$asset->get_value( 'file_name' ) : '';

I'm guessing that will result in Loki just not linking to the asset.

What you really want to do though is find assets on the site that don't have an owner and give them one. We should have a nifty script to find orphaned entities and assign them to sites, and have an active issue for it on google code - http://code.google.com/p/reason-cms/issues/detail?id=119. We should make sure this happens for Reason 4.2.

In the meantime, the best practice is to not delete old sites until you move or delete all the entities.

Nate

Steve

--
You received this message because you are subscribed to the Google Groups "Reason Discussion" group.
To post to this group, send email to reason-d...@googlegroups.com.
To unsubscribe from this group, send email to reason-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reason-discussion?hl=en.


Melissa

unread,
Feb 20, 2012, 10:16:07 AM2/20/12
to Reason Discussion
Hi Steve and Nate,

We're seeing this problem too, though for us it is showing up when
users try to upload images through loki. Same error message to the end
user. For us these are images that have just been added to the site
that is using them, so there's no chance that the error is being
caused by the images not having an owner.

Melissa

On Feb 7, 9:47 am, Nathan White <n...@natewhite.com> wrote:
> Hi Steve -
>
> I just looked at the editor_links_for_asset.php file. I suspect what is
> happening is that the site borrows an asset that no longer has an owner.
> This can occur when a site shares resources with other sites, and is then
> deleted. Reason currently lets you delete sites that are actively borrowing
> items. It should not do that, or at least it should force you to reassign
> those items to other sites.
>
> In any case, the code in editor_links_for_asset.php does this:
>
> $asset = new entity($id);
> $owner_site = $asset->get_owner();
> return 'http://' . REASON_HOST . $owner_site->get_value('base_url')
> .MINISITE_ASSETS_DIRECTORY_NAME.'/'.$asset->get_value( 'file_name' );
>
> You can see that if an asset does not have an owner, the call to
> owner_site->get_value('base_url') would cause a fatal error.
>
> I would suspect (though I'm not sure) you can fix the immediate problem by
> changing line 44 to this:
>
> return (!empty($owner_site)) ? 'http://' . REASON_HOST .
> $owner_site->get_value('base_url')
> .MINISITE_ASSETS_DIRECTORY_NAME.'/'.$asset->get_value( 'file_name' ) : '';
>
> I'm guessing that will result in Loki just not linking to the asset.
>
> What you really want to do though is find assets on the site that don't
> have an owner and give them one. We should have a nifty script to find
> orphaned entities and assign them to sites, and have an active issue for it
> on google code -http://code.google.com/p/reason-cms/issues/detail?id=119.
> We should make sure this happens for Reason 4.2.
>
> In the meantime, the best practice is to not delete old sites until you
> move or delete all the entities.
>
> Nate
>
>
>
>
>
>
>
> On Tue, Feb 7, 2012 at 9:05 AM, Steve <sly...@gmail.com> wrote:
> > I have a minisite that is having trouble loading its assets in the
> > loki link creator.
>
> > From loki, the user sees this error:
> > Failed to load the assets: Server did not respond with an RSS
> > document.
>
> > The error log has the following:
> > PHP Fatal error: Call to a member function get_value() on a non-object
> > in /usr/local/webapps/reason/reason_package/reason_4.0/lib/core/feeds/
> > editor_links_for_asset.php on line 44, referer:
>
> >https://reason.luther.edu/admin/index.php?site_id=261807&type_id=3317...

Nathan White

unread,
Feb 20, 2012, 10:27:46 AM2/20/12
to reason-d...@googlegroups.com
Hi Melissa - I'm not sure I understand when / how you get the message. Users can't upload images through Loki - they have to be uploaded to the site first and then selected. Can you reproduce the problem on all sites or just some sites? Can you outline more specifically the case where you see this?

Thx!

Nate
Message has been deleted

Melissa

unread,
Feb 20, 2012, 11:35:29 AM2/20/12
to Reason Discussion
Nate,

First off, this appears to happen only on the PC. Macs (including
mine) still work fine. We're seeing the error in Firefox (10.0.2) on
multiple PCs.

The users can upload the images in to Reason. When they go to insert
them in to a post however, they get the error message:
"Failed to load items: Server did not respond with an RSS document.
Retry."

Retry doesn't work.

I've also just received a phone call from a user who is reporting the
same issue when trying to insert a link in to a page.

This appears to be happening on all sites, certainly the 15-20 we've
tried so far.

Melissa

Nathan White

unread,
Feb 20, 2012, 11:49:49 AM2/20/12
to reason-d...@googlegroups.com
Hi Melissa - Firefox doesn't like something in the RSS feeds. I don't know what, but basically it means those browsers are not getting valid RSS for some reason. It is odd that you are only seeing it on PCs on Firefox. Does it occur with IE on PCs? What about Firefox 10.0.2 on macs?

I think the thing to do is to try to get one of these feeds and take a look to see if something looks amiss.

The urls for the feeds look like this:


Change that to put in an actual site_id at Beloit and try to load it on a mac, then on a PC in firefox. See if you can look at the source or find our anything about why firefox doesn't like it.

Are you using Reason 4.0 or 4.1?

Nate

Melissa

unread,
Feb 20, 2012, 1:45:02 PM2/20/12
to Reason Discussion
Nate,

We're using 4.1 and it works just fine on my Mac with Firefox 10.0.2.

We'll do some testing on the other things using your suggestions and
I'll be in touch.

Melissa

On Feb 20, 10:49 am, Nathan White <n...@natewhite.com> wrote:
> Hi Melissa - Firefox doesn't like something in the RSS feeds. I don't know
> what, but basically it means those browsers are not getting valid RSS for
> some reason. It is odd that you are only seeing it on PCs on Firefox. Does
> it occur with IE on PCs? What about Firefox 10.0.2 on macs?
>
> I think the thing to do is to try to get one of these feeds and take a look
> to see if something looks amiss.
>
> The urls for the feeds look like this:
>
> https://www.beloit.edu/reason/displayers/generate_feed.php?type_id=24...
Reply all
Reply to author
Forward
0 new messages