Ticket #631 (closed Patch: wontfix)

Opened 6 months ago

Last modified 2 months ago

Media Module - Images and others.

Reported by: dipunm Owned by: gregmac
Priority: blocker Milestone:
Component: Modules:Media Version: SVN HEAD
Keywords: media, images, module, Cc:

Description

I was trying to get images to appear using the media controller and found that it had a bit of a bug. I managed to overcome it, but possibly you could rewite this to be more elegant. The code here makes sure that in the case that after extracting the extension, the file is still not found, it reverts to doing what it did before (just in case)

compare with _default function in \modules\media\controllers\media.php:

	public function _default()
	{
		$type = $this->uri->segment(2);
		$filename = $this->uri->segment(3);
		// TODO: finish this for generic types
		/* issues: getting View to work with any types of files */
		$ext="";
		$ext=explode('.',$filename);
		if(is_array($ext)){
			$fext = array_pop($ext);
			$filename2 = implode('.',$ext);
			try
			{
				$view = new View('media/'.$type.'/'.$filename2, NULL, $fext);
				$view->render(TRUE);
			}
			catch (Kohana_Exception $exception)
			{
				try
				{
					$view = new View('media/'.$type.'/'.$filename);
				}
				catch (Kohana_Exception $exception)
				{
					Event::run('system.404');
				}
			}
		}else{
			try
			{
				$view = new View('media/'.$type.'/'.$filename);
			}
			catch (Kohana_Exception $exception)
			{
				Event::run('system.404');
			}
		}
	}

Change History

Changed 6 months ago by Shadowhand

  • milestone changed from 2.1.2 to 2.1.3

Changed 4 months ago by anonymous

  • milestone deleted

Milestone 2.1.3 deleted

Changed 2 months ago by Shadowhand

  • status changed from new to closed
  • resolution set to wontfix

Media module is no longer supported, see KohanaModules.

Note: See TracTickets for help on using tickets.