velletti / ke_questionnaire

This is a fork of the offical ke_questionnaire, compatible with TYPO3 - 8.7. LTS
1 stars 3 forks source link

Argument "src" has already been defined, thus it should not be defined again. #1

Closed tobiasschaeferptb closed 5 years ago

tobiasschaeferptb commented 5 years ago

Hello,

for some reason I get this error message in the Frontend Argument "src" has already been defined, thus it should not be defined again." when I try to use the KE Questionnaire plugin. The full error message from the TYPO3 log is: Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1253036401: Argument "src" has already been defined, thus it should not be defined again. | TYPO3Fluid\Fluid\Core\ViewHelper\Exception thrown in file /srv/www/libs/typo3_src-8.7.24/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php in line 168.

When I comment out the exception in the function registerArgument it works

    protected function registerArgument($name, $type, $description, $required = false, $defaultValue = null)
    {
        if (array_key_exists($name, $this->argumentDefinitions)) {
            /*throw new Exception(
                'Argument "' . $name . '" has already been defined, thus it should not be defined again.',
                1253036401
            );*/
        }
        $this->argumentDefinitions[$name] = new ArgumentDefinition($name, $type, $description, $required, $defaultValue);
        return $this;
    }

Any ideas why this happens?

Greatings

Tobias

velletti commented 5 years ago

It looks as if you are using a type of question that requieres a Viewhelper i did not fix.

i had 30 ke_questionaires made with V6 LTS and they should run in V8 ..

to find the error: disable all questions used in that ke_questionaire plugin. Find which element makes the error.

Tell me, which Question type it is maybe i can find the time to fix also that viewhelper

tobiasschaeferptb commented 5 years ago

The error occurs as soon as I include a question, with or even without an answer. For me it looks like the problem is caused by the image field within a question. But it also occurs if there isn't any image set in the question element. Here's the full stack trace as a PDF https://www.ptb.de/cms/fileadmin/user_upload/TYPO3_Exception_KE_Questionnaire.pdf

velletti commented 5 years ago

I had setup yesterday a new dev instance for this with enough data yes i can reproduce it:

the ke Image viewhelper does not work .

You have 2 Posabilities: overwrite the partial /Private/Partials/Question/QuestionImage.html and replace the

with a default fluid image viewhelper in your partial

or wait until this weekend .. i will fix it

tobiasschaeferptb commented 5 years ago

The error occurs as soon as I include a question, with or even without an answer. For me it looks like the problem is caused by the image field within a question. But it also occurs if there isn't any image set in the question element. Here's the full stack trace as a PDF https://www.ptb.de/cms/fileadmin/user_upload/TYPO3_Exception_KE_Questionnaire.pdf

tobiasschaeferptb commented 5 years ago

As you suggested in your email it is enough to replace ke:image with f:image in the partial Resources/Private/Partials/Question/QuestionImage.html: `{namespace ke=Kennziffer\KeQuestionnaire\ViewHelpers}

`
velletti commented 5 years ago

should fixed 👍 i remove ke:image in all default tempaltes/ partials and replaced it with f:image and additionally made the ke:image Viewhelper identically to the default fluid

https://github.com/velletti/ke_questionnaire/commit/f5b0d1b18e7ca763c8951b8639db00f20ad700df