Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Call to parent issue - I think 16 Dec 2016 03:24 #14849

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Admin / Cooks

I have a forked "replaced" controller class. However, I believe that the line:
	$this->_result = $result = parent::cancel();
is defeating my routine by referencing "parent". Has anyone had a similar experience in a controller?

In a rush towards a deadline and don't have the time to research it fully.

Feedback appreciated

Thanks alot
vlemos

Please Log in or Create an account to join the conversation.

Call to parent issue - I think 17 Dec 2016 16:42 #14854

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
Yes, but it was a Fork View following this (found in the Fork Doc) :

Replace by one of the following possibilities :
   $this->_parentDisplay(); 
   self::_parentDisplay(); // Static call
   return self::_parentDisplay(); //Static call with returning value

but i really don't know if the method can be used in a Forked controler ???
The following user(s) said Thank You: vlemos

Please Log in or Create an account to join the conversation.

Last edit: by liubov.

Call to parent issue - I think 21 Dec 2016 19:46 #14859

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello liubov / cooks

The simplest solution I implemented was to call the class directly. However, I added a class alias to the constructor for "_parent" and then replace parent::cancel() with _parent::cancel(). Note: you must first determine the class being called by the child.

Hope this helps some other cook working with the fork controller classes.

Warm regards
V
	/**
	 * Constructor
	 *
	 * @access	public
	 * @param	array	$config	An optional associative array of configuration settings.
	 *
	 * @return	void
	 */
	public function __construct($config = array())
	{
		parent::__construct($config);
		$app = JFactory::getApplication();

		class_alias('TestCkClassControllerItem', '_parent');

	}
	//Usage 
	$this->_result = $result = _parent::cancel();

Please Log in or Create an account to join the conversation.

Last edit: by vlemos.

Call to parent issue - I think 22 Dec 2016 11:02 #14864

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
Hi,

Good way, simplest that i 've done,
Thanks Vlemos!

Please Log in or Create an account to join the conversation.

Last edit: by liubov.

Call to parent issue - I think 19 Jan 2017 22:50 #14957

  • vlemos
  • vlemos's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 295
  • Thank you received: 41
Hello Admin

The fork framework needs revisiting as it relates to the reference "parent". Once "parent::" is called within a forked class, execution passes to the main class and never returns. Therefore forking some routines is useless. For a forked field (cktext.php), when "return parent::getInput();" is called, the input property is overwritten by the main routine.
	/**
	* Method to get the field input markup.
	*
	* @access	public
	*
	*
	* @since	11.1
	*
	* @return	string	The field input markup.
	*/
	public function getInput()
	{

		$this->input = JDom::_('html.form.input.text', array_merge(array(
				'dataKey' => $this->getOption('name'),
				'domClass' => $this->getOption('class'),
				'domId' => $this->id,
				'domName' => $this->name,
				'dataValue' => $this->value,
		'testValue' => $this->test,
				'placeholder' => $this->getOption('placeholder'),
				'prefix' => $this->getOption('prefix'),
				'responsive' => $this->getOption('responsive'),
				'size' => $this->getOption('size'),
				'suffix' => $this->getOption('suffix')
			), $this->jdomOptions));

		return parent::getInput();
	}
Please look into this and let me know if it can be easily fixed across components.

Warm regards
vlemos

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.486 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started