This is a migrated thread and some comments may be shown as answers.

Bug in MenuItem class

2 Answers 84 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 22 Aug 2016, 07:39 AM

Hi,

 

it looks like there is a bug in the separator function of the MenuItem class (\Kendo\UI\MenuItem). It uses the variable $value which can't be passed to the function when calling it.

I am using the latest Kendo UI and UI for PHP version (2016.2.714). This is the original source code from MenuItem.php lines 42 to 48:

/**
* Specifies the item should render separator
* @return \Kendo\UI\ContextMenuItem
*/
public function separator() {
    return $this->setProperty('separator', $value);
}

 

I think that should be something like this:

/**
* Specifies the item should render separator
* @param boolean $value
* @return \Kendo\UI\ContextMenuItem
*/
public function separator($value) {
    return $this->setProperty('separator', $value);
}

 

 

Best regards

Thomas

2 Answers, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
answered on 22 Aug 2016, 08:34 AM

Hi,

 

since there seems to be no way to edit my first post I have to double post, sorry for this.

 

Additionally to the changes in my first post, the @return annotation of the PHPDoc comment should be \Kendo\UI\MenuItem instead of \Kendo\UI\ContextMenuItem so the fixed code should look like this:

 

/**
* Specifies whether the item should render separator
* @param boolean $value
* @return \Kendo\UI\MenuItem
*/
public function separator($value) {
    return $this->setProperty('separator', $value);
}

 

Or like this if the function was designed as an enable only function:

/**
* Specifies the item should render separator
* @return \Kendo\UI\MenuItem
*/
public function separator() {
    return $this->setProperty('separator', true);
}

 

 

Obviously this function was kind of copied and pasted from \Kendo\UI\ContextMenuItem class where the bug with the missing parameter in the separator function's parameter list does also exist.

 

Best regards

 

Thomas

0
Alex Hajigeorgieva
Telerik team
answered on 24 Aug 2016, 10:41 AM
Hello Thomas,

Please accept my apology for the delay in responding. Your observation is correct that the MenuItem separator function is incorrect and I have logged it for a developer to fix. The issue is available at:

https://github.com/telerik/kendo-ui-core/issues/2095

Thank you very much for bringing this error in our PHP wrappers for the Kendo UI Menu to our attention.  As a token of appreciation, I have updated your Telerik points.

Regards,
Alex
Telerik by Progress
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Menu
Asked by
Thomas
Top achievements
Rank 1
Answers by
Thomas
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or