Project

General

Profile

Actions

Bug #73864

closed

Suggest wizard dont work for unsaved records using flexforms

Added by Stefan Berger about 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
FormEngine aka TCEforms
Target version:
Start date:
2016-03-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Description

Hi,

we use the suggest wizard in a flexform. When the record is unsaved, then the suggest wizard returns no results. On saved records it works successfully.

After some debuggings in the core (\TYPO3\CMS\Backend\Form\Wizard\SuggestWizard::searchAction()) it seems that $fieldConfig is empty after calling the function overrideFieldNameAndConfigurationForFlexform in that case for unsaved records.

Actions #1

Updated by Nicole Cordes about 8 years ago

  • Status changed from New to Accepted
  • Assignee set to Nicole Cordes
Actions #2

Updated by Nicole Cordes about 8 years ago

This can be tested with the felogin plugin and its redirects for example.

Actions #3

Updated by Gerrit Code Review about 8 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47223

Actions #4

Updated by Markus Klein about 8 years ago

  • Category set to FormEngine aka TCEforms
  • Target version set to 7.6.5
  • Sprint Focus set to Stabilization Sprint

Stefan, please test the patch linked above. Login with your typo3 credentials and vote then using the "Reply" button on Gerrit (review.typo3.org).
Thanks.

Actions #5

Updated by Gerrit Code Review about 8 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/47235

Actions #6

Updated by Nicole Cordes about 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Stefan Berger about 8 years ago

Hi Nicole, hi Markus,

sorry, but I can’t confirm that patch working for me.

We use the flex form in a gridelement, but that should doesn’t matter.
I’ve done again some debuggings there and here are that values I’ve got at the end in the function overrideFieldNameAndConfigurationForFlexform.

$flexfieldTCAConfig:

  array (
    'type' => 'flex',
    'ds_pointerField' => 'list_type,CType',
    'ds' =>
    array (
      'default' => '
                                                <T3DataStructure>
                                                  <ROOT>
                                                    <type>array</type>
                                                    <el>
                                                                <!-- Repeat an element like "xmlTitle" beneath for as many elements you like. Remember to name them uniquely  -->
                                                      <xmlTitle>
                                                                <TCEforms>
                                                                        <label>The Title:</label>
                                                                        <config>
                                                                                <type>input</type>
                                                                                <size>48</size>
                                                                        </config>
                                                                </TCEforms>
                                                      </xmlTitle>
                                                    </el>
                                                  </ROOT>
                                                </T3DataStructure>
                                        ',
      '*,table' => 'FILE:EXT:css_styled_content/flexform_ds.xml',
      '*,login' => 'FILE:EXT:felogin/Configuration/FlexForms/Login.xml',
      '*,gridelements_pi1' => '',
      'powermail_pi1,list' => 'FILE:EXT:powermail/Configuration/FlexForms/FlexformPi1.xml',
      'powermail_pi2,list' => 'FILE:EXT:powermail/Configuration/FlexForms/FlexformPi2.xml',
    ),
    'search' =>
    array (
      'andWhere' => 'CType=\'list\'',
    ),
  ),

$flexformDSArray:

  array (
    'sheets' =>
    array (
      'sDEF' =>
      array (
        'ROOT' =>
        array (
          'el' =>
          array (
            'field_content' =>
            array (
              'TCEforms' =>
              array (
                'config' =>
                array (
                  'type' => 'none',
                ),
              ),
            ),
          ),
        ),
      ),
    ),
  ),

$flexformElement:

  'eventlink',

$fieldConfig:

  array (
  ),

Hope that helps for fixing that case. Thanks for investigating that bug.

Actions #8

Updated by Nicole Cordes about 8 years ago

Hi Stefan,

are you sure that gridelements is doing the right things here? I have no experience with that but I can surly say that your results are wrong. So I would guess that the incoming data is already wrong. Can you post the html of the field, please.

Actions #9

Updated by Stefan Berger about 8 years ago

Hi Nicole,

mmh, I just don't know. When my flexform works for saved records, so I think my flexform is not buggy.

Here is the rendered html of the form element:

<div class="form-section">
    <div class="form-group t3js-formengine-palette-field t3js-formengine-validation-marker">
        <label class="t3js-formengine-label">
            Link zur Veranstaltung
        </label>
        <div class="t3js-formengine-field-item">
            <div class="form-wizards-wrap form-wizards-bottom">
                <div class="form-wizards-element">
                    <input class="t3js-group-hidden-field" data-formengine-input-name="data[tt_content][NEW56e68df5b176d201043825][pi_flexform][data][sDEF][lDEF][eventlink][vDEF]" value="0" type="hidden">
                    <div class="form-wizards-wrap form-wizards-aside">
                        <div class="form-wizards-element">
                            <select id="tceforms-multiselect-56e68df5d434c120313480" size="1" class="form-control tceforms-multiselect" data-formengine-input-name="data[tt_content][NEW56e68df5b176d201043825][pi_flexform][data][sDEF][lDEF][eventlink][vDEF]" data-formengine-validation-rules="[{&quot;type&quot;:&quot;group&quot;,&quot;minItems&quot;:0,&quot;maxItems&quot;:1}]"></select>
                            <div class="help-block">
                                <a href="#" onclick="setFormValueOpenBrowser('db', 'data[tt_content][NEW56e68df5b176d201043825][pi_flexform][data][sDEF][lDEF][eventlink][vDEF]|||tx_weszfuevents_domain_model_event'); return false;" class="btn btn-default">
                                <span class="t3js-icon icon icon-size-small icon-state-default icon-tcarecords-tx_weszfuevents_domain_model_event-default" data-identifier="tcarecords-tx_weszfuevents_domain_model_event-default">
                                    <span class="icon-markup">
                                        <img src="/typo3conf/ext/wes_zfu_events/Resources/Public/Icons/tx_weszfuevents_domain_model_event.gif" width="16" height="16">
                                    </span>
                                </span> 
                                Event
                                </a>
                            </div>
                        </div>
                        <div class="form-wizards-items">
                            <div class="btn-group-vertical">
                                <a href="#" class="btn btn-default t3-btn-removeoption" onclick="" data-fieldname="data[tt_content][NEW56e68df5b176d201043825][pi_flexform][data][sDEF][lDEF][eventlink][vDEF]" title="Remove selected items">
                                    <span class="t3js-icon icon icon-size-small icon-state-default icon-actions-selection-delete" data-identifier="actions-selection-delete">
                                        <span class="icon-markup">
                                            <img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-selection-delete.svg" width="16" height="16">
                                        </span>
                                    </span>
                                </a>
                            </div>
                        </div>
                    </div>
                    <input name="data[tt_content][NEW56e68df5b176d201043825][pi_flexform][data][sDEF][lDEF][eventlink][vDEF]" value="" type="hidden">
                </div>
                <div class="form-wizards-items">
                    <div class="autocomplete t3-form-suggest-container">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <span class="t3js-icon icon icon-size-small icon-state-default icon-actions-search" data-identifier="actions-search">
                                    <span class="icon-markup">
                                        <img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-search.svg" width="16" height="16">
                                    </span>
                                </span>
                            </span>
                            <input autocomplete="off" class="t3-form-suggest form-control" placeholder="Find records" data-fieldname="data[tt_content][NEW56e68df5b176d201043825][pi_flexform][data][sDEF][lDEF][eventlink][vDEF]" data-table="tt_content" data-field="pi_flexform|data|sDEF|lDEF|eventlink|vDEF" 
                                    data-uid="NEW56e68df5b176d201043825" data-pid="-1351" data-fieldtype="group" data-minchars="2" data-recorddata="a:70:{s:6:&quot;colPos&quot;;a:1:{i:0;s:2:&quot;-1&quot;;}s:16:&quot;sys_language_uid&quot;;a:1:{i:0;s:1:&quot;0&quot;;}s:5:&quot;CType&quot;;a:1:{i:0;s:16:&quot;gridelements_pi1&quot;;}s:25:&quot;tx_gridelements_container&quot;;a:1:{i:0;s:4:&quot;1023&quot;;}s:23:&quot;tx_gridelements_columns&quot;;a:1:{i:0;s:2:&quot;13&quot;;}s:30:&quot;tx_gridelements_backend_layout&quot;;a:1:{i:0;s:1:&quot;8&quot;;}s:3:&quot;pid&quot;;i:-1351;s:3:&quot;uid&quot;;s:25:&quot;NEW56e68df5b176d201043825&quot;;s:8:&quot;editlock&quot;;s:0:&quot;&quot;;s:6:&quot;hidden&quot;;s:0:&quot;&quot;;s:9:&quot;starttime&quot;;s:1:&quot;0&quot;;s:7:&quot;endtime&quot;;s:1:&quot;0&quot;;s:8:&quot;fe_group&quot;;a:0:{}s:11:&quot;l18n_parent&quot;;a:1:{i:0;s:1:&quot;0&quot;;}s:6:&quot;layout&quot;;a:1:{i:0;s:1:&quot;0&quot;;}s:4:&quot;date&quot;;s:1:&quot;0&quot;;s:6:&quot;header&quot;;s:0:&quot;&quot;;s:14:&quot;rowDescription&quot;;s:0:&quot;&quot;;s:11:&quot;header_link&quot;;s:0:&quot;&quot;;s:13:&quot;header_layout&quot;;a:1:{i:0;s:1:&quot;0&quot;;}s:9:&quot;subheader&quot;;s:0:&quot;&quot;;s:8:&quot;bodytext&quot;;s:0:&quot;&quot;;s:5:&quot;image&quot;;s:0:&quot;&quot;;s:10:&quot;imagewidth&quot;;s:1:&quot;0&quot;;s:11:&quot;imageheight&quot;;s:1:&quot;0&quot;;s:11:&quot;imageorient&quot;;s:1:&quot;0&quot;;s:11:&quot;imageborder&quot;;s:0:&quot;&quot;;s:10:&quot;image_zoom&quot;;s:0:&quot;&quot;;s:9:&quot;imagecols&quot;;s:1:&quot;2&quot;;s:4:&quot;cols&quot;;s:1:&quot;0&quot;;s:5:&quot;pages&quot;;s:0:&quot;&quot;;s:9:&quot;recursive&quot;;s:1:&quot;0&quot;;s:9:&quot;menu_type&quot;;s:1:&quot;0&quot;;s:9:&quot;list_type&quot;;s:0:&quot;&quot;;s:10:&quot;select_key&quot;;s:0:&quot;&quot;;s:16:&quot;file_collections&quot;;s:0:&quot;&quot;;s:5:&quot;media&quot;;s:0:&quot;&quot;;s:13:&quot;filelink_size&quot;;s:0:&quot;&quot;;s:16:&quot;filelink_sorting&quot;;s:0:&quot;&quot;;s:6:&quot;target&quot;;s:0:&quot;&quot;;s:7:&quot;records&quot;;s:0:&quot;&quot;;s:12:&quot;sectionIndex&quot;;s:1:&quot;1&quot;;s:9:&quot;linkToTop&quot;;s:0:&quot;&quot;;s:11:&quot;pi_flexform&quot;;a:2:{s:4:&quot;data&quot;;a:1:{s:4:&quot;sDEF&quot;;a:1:{s:4:&quot;lDEF&quot;;a:5:{s:4:&quot;logo&quot;;a:1:{s:4:&quot;vDEF&quot;;s:0:&quot;&quot;;}s:5:&quot;image&quot;;a:1:{s:4:&quot;vDEF&quot;;s:0:&quot;&quot;;}s:8:&quot;pretitle&quot;;a:1:{s:4:&quot;vDEF&quot;;s:0:&quot;&quot;;}s:9:&quot;eventlink&quot;;a:1:{s:4:&quot;vDEF&quot;;s:0:&quot;&quot;;}s:7:&quot;altlink&quot;;a:1:{s:4:&quot;vDEF&quot;;s:0:&quot;&quot;;}}}}s:4:&quot;meta&quot;;a:0:{}}s:17:&quot;tx_impexp_origuid&quot;;s:0:&quot;&quot;;s:19:&quot;accessibility_title&quot;;s:0:&quot;&quot;;s:20:&quot;accessibility_bypass&quot;;s:0:&quot;&quot;;s:25:&quot;accessibility_bypass_text&quot;;s:0:&quot;&quot;;s:15:&quot;l18n_diffsource&quot;;s:0:&quot;&quot;;s:11:&quot;t3ver_label&quot;;s:0:&quot;&quot;;s:19:&quot;selected_categories&quot;;s:0:&quot;&quot;;s:14:&quot;category_field&quot;;s:0:&quot;&quot;;s:13:&quot;table_caption&quot;;s:0:&quot;&quot;;s:15:&quot;table_delimiter&quot;;s:3:&quot;124&quot;;s:15:&quot;table_enclosure&quot;;s:1:&quot;0&quot;;s:21:&quot;table_header_position&quot;;s:1:&quot;0&quot;;s:11:&quot;table_tfoot&quot;;s:1:&quot;0&quot;;s:10:&quot;categories&quot;;a:0:{}s:15:&quot;header_position&quot;;a:0:{}s:17:&quot;image_compression&quot;;s:0:&quot;&quot;;s:13:&quot;image_effects&quot;;s:0:&quot;&quot;;s:12:&quot;image_noRows&quot;;s:0:&quot;&quot;;s:13:&quot;section_frame&quot;;a:1:{i:0;s:1:&quot;0&quot;;}s:10:&quot;spaceAfter&quot;;s:1:&quot;0&quot;;s:11:&quot;spaceBefore&quot;;s:1:&quot;0&quot;;s:13:&quot;table_bgColor&quot;;s:1:&quot;0&quot;;s:12:&quot;table_border&quot;;s:1:&quot;0&quot;;s:17:&quot;table_cellpadding&quot;;s:1:&quot;0&quot;;s:17:&quot;table_cellspacing&quot;;s:1:&quot;0&quot;;s:24:&quot;tx_gridelements_children&quot;;s:0:&quot;&quot;;}" 
                                    type="search">
                        </div>
                        <div style="position: absolute; display: none; max-height: 300px; z-index: 9999;" class="autocomplete-results"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

Here is the flexform xml for the field:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
    <meta>
        <langDisable>1</langDisable>
    </meta>
    <ROOT>
        <type>array</type>
        <el>
            <eventlink>
                <TCEforms>
                    <label>LLL:fileadmin/locallang/gridelements/maincolumn_container_slider_item.xml:eventlink</label>
                    <config>
                        <type>group</type>
                        <internal_type>db</internal_type>
                        <allowed>tx_weszfuevents_domain_model_event</allowed>
                        <size>1</size>
                        <maxitems>1</maxitems>
                        <minitems>0</minitems>
                        <show_thumbs>0</show_thumbs>
                        <disable_controls>upload,browser,delete</disable_controls>
                        <wizards>
                            <_PADDING>1</_PADDING>
                            <_VERTICAL>0</_VERTICAL>
                            <_POSITION>bottom</_POSITION>
                            <suggest>
                                <type>suggest</type>
                                   <default>
                                        <searchWholePhrase>1</searchWholePhrase>
                                        <additionalSearchFields>eventcode</additionalSearchFields>
                                   </default>
                            </suggest>
                        </wizards>
                    </config>
                </TCEforms>
            </eventlink>
        </el>
    </ROOT>
</T3DataStructure>

Maybe you could show me the fault, if there is any.

Actions #10

Updated by Nicole Cordes about 8 years ago

Hi Stefan,

may I invite you to slack (https://forger.typo3.org/slack) to discuss your environment and find a solution for your problem?

Actions #11

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF