Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello! The migx problem in the renderChunk method was found and fixed. Push to release! #334

Open
vitaliy-voropaev opened this issue Jan 28, 2019 · 0 comments · May be fixed by #409
Open

Comments

@vitaliy-voropaev
Copy link

Important! The problem relates to the type Input TV type listbox-multiple. If there are two or more IDs in options. They are passed to the render chunk as an Array, which leads to an error.

Solution below:

function renderChunk($tpl, $properties = array(), $getChunk = true, $printIfemty = true) {
    $propertiestype = array();
    foreach ($properties as $key => $prop) {
        if (is_array($prop) && count($prop) > 0) {
            $propertiestype[$key] = implode(',',$prop);
        } else {
            $propertiestype[$key] = $prop;
        }
    }
    $properties = $propertiestype;
    
    $value = $this->parseChunk($tpl, $properties, $getChunk, $printIfemty);

    $this->modx->getParser();
    /*parse all non-cacheable tags and remove unprocessed tags, if you want to parse only cacheable tags set param 3 as false*/
    $this->modx->parser->processElementTags('', $value, true, true, '[[', ']]', array());

    return $value;
}

Do not thank!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant