Skip to content
This repository

IE-related problems #94

Closed
Guite opened this Issue · 6 comments

2 participants

Axel Guckelsberger Erik Spaan
Axel Guckelsberger
Collaborator
Guite commented

This is about Content version 3.2, but probably affects version 4 as well.

Problem 1:
If I try to create a sub page in Internet Explorer I get the following message: Error! Cannot create sub-page without parent page ID.

Problem 2:
If I try to increase indention in the page tree (to make a main page becoming a sub page) the page reloads, but nothing happened to the selected page.

I suspect that there is a general issue with Internet Explorer related to the form postback functionality (which is used for the whole context menu which can be shown by clicking on the blue arrow).

Erik Spaan
Collaborator
Erik Spaan
Collaborator
espaan commented

Within IE the commandArgument with the page.id in it is not coming through. This part is being dealt with in pnForm (or Form) with the JS part in pnform.js. Checking why IE does not recognize the page.id.
Have to check why FF and Safari for instance do have this commandargument filled in.

Erik Spaan
Collaborator
espaan commented

Tracked it down to pnformcontextmenuitem.php

There is defined in the zk12x code (same is still there in the 1.3.x code)

    // Called by pnForms framework due to the use of pnFormGetPostBackEventReference() above
    function raisePostBackEvent(&$render, $eventArgument)
    {
        $contextMenu =& $this->getParentContextMenu();

        $hiddenName = "contentMenuArgument" . $contextMenu->id;
        $commandArgument = FormUtil::getPassedValue($hiddenName, null, 'POST');

        $args = array('commandName' => $eventArgument, 'commandArgument' => $commandArgument);
        $render->pnFormRaiseEvent($contextMenu->onCommand == null ? 'handleCommand' : $contextMenu->onCommand, $args);
    }

The commandargument is obtained from the hidden field contentMenuArgumentcontentTocMenu which is defined in the form framework for contextmenus. This field should obtain the value of the current page.id via Javascript (pnform.js function pnForm.contextMenu.showMenu) when a menu item is called on the context menu. This seems to work fine. However in IE the commandargument in the function raisePostBackEvent is not filled, when it is nicely being filled in FF and Safari etc.

When I fill in 0 or 1 for instance for the defaul.t of the getPassedValue of the hiddenname then it works ok calling for instance newsubpage with that value.

It seems to be a general IE issue with obtaining form values from a hidden div. The context menu is hidden with display:none and then the code tries to get the formvalue for the page id which is not obtainable.

Erik Spaan
Collaborator
espaan commented

The solution is to adjust block.pnformcontextmenu.php -> renderBegin function

            $hiddenName = "contentMenuArgument" . $this->id;
            $html = "<div id=\"{$this->id}\" class=\"$cssClass\"$attributes><div><input type=\"hidden\" name=\"$hiddenName\" id=\"$hiddenName\" /></div><ul>";
            return $html;

to

            $hiddenName = "contentMenuArgument" . $this->id;
            $html = "<div><input type=\"hidden\" name=\"$hiddenName\" id=\"$hiddenName\" /></div><div id=\"{$this->id}\" class=\"$cssClass\"$attributes><ul>";
            return $html;

So taking the hidden form field which holds the current argument outside the hidden div of the contextmenu. This works fine in IE and FF.

Same can be done in the Zikula_Form_Block_ContextMenu::renderBegin function of the zk1.3 code.

Erik Spaan
Collaborator
espaan commented

See zikula/core#423 for the code in Zikula 1.3.x

Erik Spaan
Collaborator
espaan commented

The 1.3 code is merged in the release-1.3 code, so will get into the source with a new release.

For 1.2.x there is no such issue system any more. You can change
/system/pnForm/plugins/block.pnformcontextmenu.php

line 114:

            $html = "<div id=\"{$this->id}\" class=\"$cssClass\"$attributes><input type=\"hidden\" name=\"$hiddenName\" id=\"$hiddenName\"/><ul>";

into

            $html = "<input type=\"hidden\" name=\"$hiddenName\" id=\"$hiddenName\"/><div id=\"{$this->id}\" class=\"$cssClass\"$attributes><ul>";

I will close the ticket. I would really like to release a new zk 1.2.10 version with this fix in it, but It's not high priory for the team

Erik Spaan espaan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.