Ticket #771 (closed Patch: fixed)

Opened 3 months ago

Last modified 3 months ago

Smarty module patch for bug w/ partials

Reported by: ixmatus Owned by: armen
Priority: minor Milestone: 2.2.1
Component: Modules Version: SVN HEAD
Keywords: smarty module modules bug patch Cc:

Description

Inside MY_View.php of the the Smarty module, this line prevents partials from properly being sharded into templates:

...
7 	        $type = NULL;
...

To fix the issue, I made the code a little bit more flexible:

class View extends View_Core {

	public function __construct($name, $data = NULL, $type = NULL)
	{
		if (Kohana::config('smarty.integration') == TRUE AND Kohana::find_file('views', $name, FALSE, is_null($type)?'tpl':$type))
		{
			$type = empty($type) ? Kohana::config('smarty.templates_ext') : 'tpl';
		}

		parent::__construct($name, $data, $type);
	}
}

Partials are now loaded properly with their .tpl extensions when no extension is provided in the view lib constructor...

Change History

Changed 3 months ago by ixmatus

  • owner changed from - No owner - to armen

Changed 3 months ago by nicklevett

I believe this is the same as my ticket #709?

Changed 3 months ago by armen

Fixed in r3335

Changed 3 months ago by armen

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.