naoaki011 / mt-plugin-assethandler

Adds a Batch Edit option to the drop down menu on the asset listing screens. An importer allows you to easily import existing files on your server into Movable Type as assets.
http://plugins.movalog.com/asset-handler/
5 stars 2 forks source link

Error Occurs When mt-plugin-assethandler is Used in Conjunction with Some Custom Asset Types #19

Open daveaiello opened 12 years ago

daveaiello commented 12 years ago

When I install mt-plugin-assethandler and choose "Manage Assets" (http://mysite.com/cgi-bin/mt/mt.cgi?__mode=list_asset&blog_id=1) on a blog with any remotely-hosted assets, the following error occurs:

Can't locate object method "file_size" via package "MT::FileMgr::Local" at /path/to/cgi-bin/mt/plugins/AssetHandler/lib/AssetHandler/App/CMS.pm line 612.

If I choose "Manage Assets" for a blog where there are no assets or no assets that are remotely-hosted, the error does not occur.

naoaki011 commented 12 years ago

Hello I fix it on this errors. https://github.com/naoaki011/mt-plugin-assethandler/commit/8325dbb8896f90cf9de221c447d59bfae37c1d8a

daveaiello commented 12 years ago

The new version does not trigger an error. However, your comment on the commit listed above says that you are bypassing errors in Movable Type 4.24 and earlier. This was not the problem that I was reporting.

The problem I pointed out is that remove-hosted assets have no file_size because they are stored externally.

We are creating Custom Asset Types that represent things like Flickr Photos, YouTube Videos, Soundcloud Audio Clips. These assets probably will not have sizes. Or if they do, will not refer to the size of a file stored on the file system.

Do you think that this commit is the right way to fix a file_size problem on a Custom Asset Type?

naoaki011 commented 12 years ago

Before release tested for Some Custom Asset Types of no sizez.(eg LinkRoller GeoType YoutubeAsset) Can you tell me your Custom Asset Type Plugin and Working MT Version.

daveaiello commented 12 years ago

Our plugin is not completed yet. To test remote-hosted assets, I have used mt-plugin-podcasting with Movable Type 4.37.

See: https://github.com/byrnereese/mt-plugin-podcasting

This creates an asset pointing to an MP3 file on an external file system such as a CDN.

naoaki011 commented 12 years ago

I'm tested podcasting plugin on MT4.38. But this plugin not work on my environment.(may be not implemented for non multibyte use.)

naoaki011 commented 12 years ago

Trace code in your report.

Can't locate object method "file_size" via package "MT::FileMgr::Local" at /path/to/cgi-bin/mt/plugins/AssetHandler/lib/AssetHandler/App/CMS.pm line 612.

This block was only work for MT5.0x and has RealFile on testing. something wrong is you environment?

daveaiello commented 12 years ago

I don't think there's anything wrong in my environment. The problem might be that Podcast Assets created with the help of the Podcasting plugin don't have a file size because they are not stored on the local file system.

The way that the Podcasting plugin creates assets may not be completely correct. I am not the maintainer of that plugin. I am simply using it as a way to create remotely-hosted assets in the Asset Manager for testing purposes in another Movable Type application.

naoaki011 commented 12 years ago
  1. part of bug report is for MT5.0x code. that part branched MT Version Number (MT->version_number). my environment of MT4.38 is not use this part.
  2. object method "file_size" is inside of under code. that is active only real file.

    if ( $file_path && $fmgr->exists( $file_path ) ) { .... }

  3. Podcasting plugin define file_path as undef. it is related to this problem. but this plugin is not work for me. no test.

    sub file_path { my $asset = shift; return undef; }