Bug in MenuItem class

3 posts, 0 answers
  1. Thomas
    Thomas avatar
    5 posts
    Member since:
    Jul 2016

    Posted 22 Aug Link to this post

    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. Thomas
    Thomas avatar
    5 posts
    Member since:
    Jul 2016

    Posted 22 Aug in reply to Thomas Link to this post

    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

  3. UI for ASP.NET AJAX banner
  4. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    114 posts

    Posted 24 Aug Link to this post

    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!
Back to Top