[TYPO3-dev] 6.2: Form Viewhelper Submit ignores Action Name after Update

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Fri Oct 3 13:43:32 CEST 2014


Hi there

Some strange issue makes me nuts for days now:

I'm using the form viewhelper in my template. When the data is
submitted, the wrong action gets called.
In TYPO 4.6 the same form and controller was working.


The form (in ServiceangeboteEdit.html) looks like this:

<f:form action="serviceangeboteUpdate">
    <f:for each="{serviceangebots}" as="angebot">
        <f:form.checkbox name="isAllgemein[{angebot.uid}]" value="true"
                            checked="{h:hasService(klinik:klinik,
serviceangebot:angebot, property:'isAllgemein')}" />
        ...
    </f:for>
    <f:form.textfield name="newServiceName" />
    <f:form.hidden name="gruppe" value="{gruppe}" />
    <f:form.submit value="Send"/>
</f:form>

The controller (LeistungenPAController) looks like this:

        /**
         *
         * Edit serviceangebote
         */
        public function serviceangeboteEditAction() {
                $gruppe_id = $_REQUEST['gruppe_id'];
                $gruppe =
$this->serviceangebotGruppeRepository->findByUid($gruppe_id);
                $klinik = $this->getKlinik();

                $serviceangebots =
$this->serviceangebotRepository->findForEdit($gruppe_id,
$klinik)->toArray();
                Tx_Hplusinfo_Utility_Array::sortByName($serviceangebots);

                $this->view->assignMultiple(array(
                        'gruppe' => $gruppe,
                        'klinik' => $klinik,Y
                        'serviceangebots' => $serviceangebots,
                ));
        }

        /**
         * Update serviceangebote
         *
         * @param string $newServiceName
         * @param Tx_Hplusinfo_Domain_Model_ServiceangebotGruppe $gruppe
         * @param array $isAllgemein
         * @param array $isHalbprivat
         * @param array $isPrivat
         */
        public function serviceangeboteUpdateAction($newServiceName,
            Tx_Hplusinfo_Domain_Model_ServiceangebotGruppe $gruppe,
            array $isAllgemein, array $isHalbprivat, array $isPrivat)
        {
             die("Where am I?!");
        ....
        }

ext_localconf.php:
Tx_Extbase_Utility_Extension::configurePlugin(
    $_EXTKEY,
    'Pa_serviceangebote',
    array(
        'LeistungenPA' =>
'serviceangeboteShow,serviceangeboteEdit,serviceangeboteUpdate,serviceangeboteDelete',
       
    ),
    // non-cacheable actions
    array(
        'LeistungenPA' =>
'serviceangeboteShow,serviceangeboteEdit,serviceangeboteUpdate,serviceangeboteDelete',
           
    )
);

PA stands for protected area, i.e. the plugin is on a login protected
page (fe_user).

You can find the resulting error message here:
https://owncloud.dataforge.ch/public.php?service=files&t=d5fe9dcddd3b4d6d505738f3904bb45a

"#1: PHP Warning: htmlspecialchars() expects parameter 1 to be string,
array given in
/var/www/typo3_src-6.2.5/typo3/sysext/fluid/Classes/Core/ViewHelper/TagBuilder.php
line 174"

Why is the tag builder called?
Later on we find this line:
FluidCache_Hplusinfo_LeistungenPA_action_serviceangeboteEdit_7960d5414ac3f492017a4c4798ff57c6116d11a6::render(TYPO3\CMS\Fluid\Core\Rendering\RenderingContext)
Here we see that action_serviceangeboteEdit is rendered from Fluid
cache. Why this? The called action should be "serviceangeboteUpdate"!

- serviceangeboteEditAction ist not the controller's default action.
- Caching is disabled.
- URL looks ok:
index.php?id=leistungen-login&no_cache=1&L=0&tx_hplusinfo_pa_serviceangebote[action]=serviceangeboteUpdate&tx_hplusinfo_pa_serviceangebote[controller]=LeistungenPA

All this makes no sense to me.
Any help is very much appreciated!
Till



More information about the TYPO3-dev mailing list