GithubHelp home page GithubHelp logo

phorax / formhandler Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 54.0 4.14 MB

Fork of TYPO3 extension «Formhandler»

License: GNU General Public License v2.0

PHP 95.91% TypeScript 0.04% HTML 2.05% JavaScript 2.00%

formhandler's People

Contributors

7elix avatar amphx avatar bmack avatar denislorch avatar jmverges avatar josefglatz avatar kaywalker avatar marcoremy avatar mbrodala avatar mgrn0 avatar navsaj avatar pulponair avatar reinhardfuehricht avatar sabbelasichon avatar sbuerk avatar schweriner avatar svenjuergens avatar tlueder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

formhandler's Issues

notation like EXT:extensionName in TypoScript displays an error in TYPO3 v9

If I use the notation EXT:extensionName/... in typoscript in TYPO3 v9, for example for the langFile, the frontend displays an error for this line: web/typo3conf/ext/formhandler/Classes/Utility/GeneralUtility.php:681

The method extRelPath is deprecated:
https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/8.4/Deprecation-78193-ExtensionManagementUtilityextRelPath.html

Notation like typo3conf/ext/extensionName/... is possible

No Output in Formsite Frontend on 8.7.8

I installed you extension but i only got a empty div on the formsite.
Also by activated debugs without any error outbut
`plugin.Tx_Formhandler.settings.predef.validation-contact {

debug = 1 
addErrorAnchors = 1  

name = Kontakt Formular`

I copyed a old TS from a working typo web (7.6.x), so the TS code should be fine.
There is no output and also no error in any logfile.
Any suggestions to this issue?

Compatibility LTS9

is there any official compatibility with LTS 9 planned, if yes is there a timeframe for it? thanks a lot for your feedback

plugin creation in gridelements container fails

TYPO3 7.6.15 +gridelements 7.0.6-dev + bootstrap_grids 1.3.1 + formhandler 2.4.0

Create a grid-CE on a page.
Create a formhandler-plugin inside a column of that grid-CE.
The formhandler-plugin is not there because fields tx_gridelements_columns and tx_gridelements_container set to 0.
Any other CE works, but not formhandler-plugin.

Creation of formhandler-plugins outside a grid-CE works, also moving that plugin into grid-CE. Only creation inside grid-CE fails.

Issue with leaving a multi-step form and coming back again

If users leave a form at step 2 or higher without submitting and come back later, formhandler will prefill the form with the data from the session and show them the unsubmitted step.
The form will however not work, because the form tag is missing.
The problem originates in \Typoheads\Formhandler\View\Form::render(), Line 100ff.:

if (!$this->gp['submitted']) {
$this->storeStartEndBlock();
} elseif ((int)($this->globals->getSession()->get('currentStep')) !== 1) { 
$this->fillStartEndBlock();
}

Because the step was not submitted, the StartEndBlock will not be restored from the session.
Solution 1: Remove the "else" and make it two independent conditions (or alternatively re-order the sequence)
Solution 2: If not submitted and currentStep > 1, change currentStep = 1 before rendering

I'm currently not sure, which solution would be the better one.

Typo3 11, setup

Hi I am trying to bring some old mega-forms to typo3 11, after an update, in 10 the templateFile, langFile and cssFile paths seem to work in the setup ( plugin.Tx_Formhandler.settings { ... } ), in typo3 11 only the templateFile is accetped, the other two aren't. Is there a way to set these paths otherwise?

In the Plugin Options (flexform), I can only select the folder, and not the files.

Form validation ajax - replace loadCachedTca with initTCA

This is already covered with pull request #4, but since this was not merged for a long time i'd ask to at least fix this simple issue to make form validation using ajax (eID) work again.

diff --git a/Classes/Utility/GeneralUtility.php b/Classes/Utility/GeneralUtility.php
index 9cf4d7a..a691392 100644
--- a/Classes/Utility/GeneralUtility.php
+++ b/Classes/Utility/GeneralUtility.php
@@ -839,7 +839,7 @@ class GeneralUtility implements SingletonInterface
         $GLOBALS['TSFE']->fe_user->fetchGroupData();
 
         // Include the TCA
-        \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
+        \TYPO3\CMS\Frontend\Utility\EidUtility::initTCA();
 
         // Get the page
         $GLOBALS['TSFE']->fetch_the_id();

Security fix

There is a security fix in formhandler 2.4.1 (released yesterday), I think this should be fixed here, too.

FileRequired errorcheck PHP error > count() on noncountable object

suggestion to make a simpler condition avoiding null variable

      if (!$found && !$sessionFiles[$this->formFieldName]) {
   		$checkFailed = $this->getCheckFailed();
       }

if (!$found && count($sessionFiles[$this->formFieldName]) === 0) {

TYPO3 8.7
Core: Error handler (FE): PHP Warning: count(): Parameter must be an array or an object that implements Countable in /sites/gazvacancy/htdocs/typo3conf/ext/formhandler/Classes/Validator/ErrorCheck/FileRequired.php line 35

Version number

Could you please return to numbering ext version, like in any other extension. We have now ~10 installations with different versions tested to compare and now after a few months I have absolutely no idea which is which, which is newer, it's a huge problem when maintaining many projects, with xclasses, during updates, calculations and analysis. Please just put it back there

Call to undefined method ContentObjectRenderer::IMAGE()

When setting singleFileMarkerTemplate.showThumbnails an exception is thrown once a file has been uploaded:

Uncaught TYPO3 Exception
Call to undefined method TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::IMAGE() 

Error thrown in file
/.../typo3conf/ext/formhandler/Classes/View/Form.php in line 920.

21 Typoheads\Formhandler\View\Form::getThumbnail(array, array)

/.../typo3conf/ext/formhandler/Classes/View/Form.php:
00813:                     if (intval($settings['singleFileMarkerTemplate.']['showThumbnails']) === 1 || intval($settings['singleFileMarkerTemplate.']['showThumbnails']) === 2) {
00814:                         $imgConf['image.'] = $settings['singleFileMarkerTemplate.']['image.'];
00815:                         $thumb = $this->getThumbnail($imgConf, $fileInfo);
00816:                     }
00817:                     $text = $this->utilityFuncs->getSingle($settings['files.'], 'customRemovalText');

20 Typoheads\Formhandler\View\Form::fillFileMarkers(array)

/.../typo3conf/ext/formhandler/Classes/View/Form.php:
00610:         $this->fillCaptchaMarkers($markers);
00611:         $this->fillFEUserMarkers($markers);
00612:         $this->fillFileMarkers($markers);
00613: 
00614:         if (!strstr($this->template, '###HIDDEN_FIELDS###')) {

19 Typoheads\Formhandler\View\Form::fillDefaultMarkers()

/.../typo3conf/ext/formhandler/Classes/View/Form.php:
00107: 
00108:         //fill default markers
00109:         $this->fillDefaultMarkers();
00110: 
00111:         if (intval($this->settings['fillValueMarkersBeforeLangMarkers']) !== 1) {

18 Typoheads\Formhandler\View\Form::render(array, array)

/.../typo3conf/ext/formhandler/Classes/Controller/Form.php:
00368:                 return $this->processFinished();
00369:             } else {
00370:                 return $this->view->render($this->gp, $this->errors);
00371:             }
00372:         } else {

17 Typoheads\Formhandler\Controller\Form::processSubmitted()

/.../typo3conf/ext/formhandler/Classes/Controller/Form.php:
00147:             return $this->processNotSubmitted();
00148:         } else {
00149:             return $this->processSubmitted();
00150:         }
00151:     }

16 Typoheads\Formhandler\Controller\Form::process()

/.../typo3conf/ext/formhandler/Classes/Controller/Dispatcher.php:
00112:             }
00113: 
00114:             $result = $controller->process();
00115:         } catch (\Exception $e) {
00116:             \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog(

15 Typoheads\Formhandler\Controller\Dispatcher::main("", array)

/.../typo3conf/ext/formhandler/pi1/class.tx_formhandler_pi1.php:
00044:         $dispatcher = new \Typoheads\Formhandler\Controller\Dispatcher();
00045:         $dispatcher->cObj = &$this->cObj;
00046:         return $dispatcher->main($content, $conf);
00047:     }
00048: }

14 tx_formhandler_pi1::main("", array)
...

This and other similar methods have been dropped in TYPO3v8 after deprecation in v7.

☂️ Add support for Typo3 11.5.x

Filing as an umbrella bug for the overall feature of adding all fixes for Typo3 11.5.x

Split up the work done in RP #83

System setup:

php 7.4
Typo3 v11.5.x
debug mode on
error level 12290

Work log

  • dev and updated dependencies #86
  • persistence configuration #87
  • fix TCA Utility #88
  • adding types (up to php 7.4 support)
  • set strict_types = 1 in all files
  • adding null checks
  • removed dead code

New features

  • fix resolvePath starting with typo3conf
  • handle multiple template files

filter formhandler log throws an error

When i use the filter in the forhandler log and set an startdate i get following error:

An error occurred while trying to call Typoheads\Formhandler\Controller\ModuleController->indexAction()

I tried formhandler 2.4.1 and also 3.1.0 but same problem appears. I am using TYPO3 8.7.20

Exception when view a log due to a bug in IsArrayViewHelper

When I try to view a log in "Formhandler" backend module, I get an exception(stack below).

TYPO3: 8.7.20
Formhandler: 3.0.0

Error stack

Uncaught TYPO3 Exception
Subject given to f:count() is not countable (type: string) 

TYPO3Fluid\Fluid\Core\ViewHelper\Exception thrown in file
.../vendor/typo3fluid/fluid/src/ViewHelpers/CountViewHelper.php in line 70.

31 TYPO3Fluid\Fluid\ViewHelpers\CountViewHelper::renderStatic(array, Closure, TYPO3\CMS\Fluid\Core\Rendering\RenderingContext)

.../public/typo3temp/var/Cache/Code/fluid_template/Module_action_view_19ca6c025e5a7b2a83c84a119983166163e9c96a.php:
00411: $arguments41 = array();
00412: $arguments41['subject'] = NULL;
00413: $renderChildrenClosure42 = ($arguments41['subject'] !== null) ? function() use ($arguments41) { return $arguments41['subject']; } : $renderChildrenClosure42;$array40['0'] = TYPO3Fluid\Fluid\ViewHelpers\CountViewHelper::renderStatic($arguments41, $renderChildrenClosure42, $renderingContext);
00414: $array40['1'] = ' > 0';
00415: 

30 Module_action_view_19ca6c025e5a7b2a83c84a119983166163e9c96a::{closure}()

.../vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractConditionViewHelper.php:
00083:             }
00084:             if (isset($arguments['__thenClosure'])) {
00085:                 return $arguments['__thenClosure']();
00086:             }
00087:         } elseif (!empty($arguments['__elseClosures'])) {

29 TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper::renderStatic(array, Closure, TYPO3\CMS\Fluid\Core\Rendering\RenderingContext)

.../public/typo3temp/var/Cache/Code/fluid_template/Module_action_view_19ca6c025e5a7b2a83c84a119983166163e9c96a.php:
00444: };
00445: 
00446: $output33 .= Typoheads\Formhandler\ViewHelpers\IsArrayViewHelper::renderStatic($arguments35, $renderChildrenClosure36, $renderingContext);
00447: 
00448: $output33 .= '

Page messed up: wrong fluid layout

The forms are displayed, but the page is messed up: it uses the layout “Default.html“ from typo3/sysext/fluid_styled_content/Resources/Private/Layouts/Default.html instead of my defined layout (page.10.layoutRootPath).

tt_address.hidden field prevents authcode generation?

working with a more current fork of this one (https://github.com/dmind-gmbh/formhandler) and the discontinued EXT:formhandler_subscription on TYPO3 v9:

  • an tt_address record is created with tt_address.hidden = 1. The record is supposed to stay hidden until the double opt-in by email-link is done, which takes the hidden flag away.
  • this was the case with the older version of Finisher/GenerateAuthCode.php
    using exec_SELECTquery() f676f4c#diff-66782a4338e40dd2907a310cbf419c7c
  • further down in the named commit are several $queryBuilder->getRestrictions()->removeByType(HiddenRestriction::class);

Is that not needed in GenerateAuthCode.php, too?

confused about the Versions

In the description this is the version for TYPO3 8.7 but in the files there are customizations for TYPO3 9.5, like e.g. in ext_emconf.php

There is only one branch "Master", is there a formhandler version for TYPO3 8.7?
I was hoping to find at least one branch for version 8 :)

errorCheck float

If you use errorCheck float then you get the error: Fatal error: Cannot use 'Float' as class name as it is reserved in /html/typo3/typo3conf/ext/formhandler/Classes/Validator/ErrorCheck/Float.php on line 20

You have to rename Float.php into f.e. Phpfloat.php
Then rename the class in this file the same way.
And then you can use phpfloat as errorCheck.

Page messed up

I used the latest commit with TYPO3 8, the forms are displayed, but the page is messed up (parts are missing).

Changing Session Settings throws Warning in PHP 7.2

Formhandler uses a own session for storing values. It can be configured to not use cookies. This is done by modifing php ini settings. Unfortunally PHP 7.2 throws a warning when changing a session ini setting after the session was started.

In the class Typoheads\Formhandler\Session\AbstractSession and start() function there is already a check if the session is started or not. The lines for modifing the ini settings should be moved inside the if condition so it will be executed only once when the session was not started.

No output on Frontend

I installed the master but i doesn't get any output from formhandler on frontend. Only the Header Title will be displayed ... cache cleard. Formhandler can element can be displayed and edited in Backend.

Enable alternative IP Detection for logging and ipblock checking,

Scenario:
If there is any sort of proxy or caching server in front of your actuall application server (e.g. varnish or nginx proxy/lb) $_SERVER['REMOTE_ADDRESS'] may alway contain 127.0.0.1

That issue is related to logging and the ipblocking Interceptor. And may result in your forms getting blocked.

Solution 1:
Introduce some sort of automatic detection e.g.:
check if REMOTE_ADDRESS points to 127.0.0.1 and check for the existens of e.g. $_SERVER['HTTP_X_REAL_IP'] (Might varydepending on the actuall infrastructure).

Solution 2:
Introduce some sort of configuration for that.

Note:
Keep in mind that \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv is not aware of any key in e.g. $_SERVER.

double encoding in TYPO 9.5

hi @7elix

if you have a normal form on a site and use some special character in the fields like & or ", this got encoded twice. "&" --> $amp;amp;
it's related to this change: 5a1e223

with TYPO3 8 all things went fine, but in 9.5 you have the double encoding.
do you have an idea where that comes from and how to fix it?

best regards
Sven

Finisher DB does not work

For DB Inserts using the QueryBuilder we have to use ->values instead of ->set (which is for updates)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.