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

Errors with modx 2.6.0 #9

Open
wax100 opened this issue Dec 7, 2017 · 8 comments
Open

Errors with modx 2.6.0 #9

wax100 opened this issue Dec 7, 2017 · 8 comments

Comments

@wax100
Copy link

wax100 commented Dec 7, 2017

  1. Do not save TV name after create because the name of TV "dynamicdropdown_multiple" is too long. Database field can store only 20 symbols.

  2. dynamicdropdown_multiple TV has not correct CSS (see attach)

  3. JS mistake Uncaught ReferenceError: $connector_path is not defined in

core/components/dynamicdropdowntv/tv/input/tpl/dynamicdropdown.tpl
core/components/dynamicdropdowntv/tv/input/tpl/dynamicdropdown_multiple.tpl
  1. If manually fix 1,2,3 and try to save TV with more than one value - in database we will see only one value.

  2. And after page reload we get empty field, so values do not render from DB

@BazMaster
Copy link

The problem is not solved yet. Multiple values are not stored or displayed in the TV.

@BazMaster
Copy link

@Bruno17 How to fix this error?

nicar pushed a commit to nicar/DynamicDropdownTV that referenced this issue Sep 18, 2018
- create alternative class with shorter name
- fixed x-form trigger buttons
- fixed connector url
- fixed saving multiple values to DB
- fixed load values
@nicar
Copy link

nicar commented Sep 18, 2018

@wax100 @BazMaster see my commit above. Should be sufficient to just put those 4 files in the respective folders and then use the "dynamicdropdown_mlti" TV instead.

@nicar nicar mentioned this issue Sep 18, 2018
@BazMaster
Copy link

@nicar Thanks for help! Only the values are not loaded at the TV after a page reload!

@nicar
Copy link

nicar commented Sep 20, 2018

@nicar Thanks for help! Only the values are not loaded at the TV after a page reload!

How many and what fields are you using? I only tested a "normal" dynamicdropdown TV in combination with one dynamicdropdown multi TV.
I made some changes in my latest commit so it should work with at least two dddx-multi TVs.

nicar@4cdf3cc

@BazMaster
Copy link

BazMaster commented Oct 18, 2018

@nicar Hi!
The values are still not loaded after the page is reloaded, despite changes in the files: https://file.modx.pro/files/5/d/4/5d4e9fc284412c26e1b8099a8c6ead3d.gif .

@nicar
Copy link

nicar commented Oct 24, 2018

@BazMaster
True, it worked only when using input Option values with direct input or bindings.
A few changes to the getoptions will make it work. I already dit it at your install.

I will push the changes later to my repo.

in DynamicDropdownTV/core/components/dynamicdropdowntv/processors/mgr/default/getoptions.default.php replace line 72-76

if (!empty($query)) {
	$c->where(array($namefield . ':LIKE' => $query . '%'));
} else {
	$options[] = array('id' => '', 'name' => $firstText);
}

with

if (!empty($query)) {
    $tmp = explode('|', $query);
    $num = true;
    foreach($tmp as $t) {
        $num = ($num && is_numeric($t));
    }

    if($num) {
        $c->where(array($idfield . ':IN' => $tmp) );
    } else {
        $c->where(array($namefield . ':LIKE' => $query . '%'));
    }    
} else {
	$options[] = array('id' => '', 'name' => $firstText);
}

@BazMaster
Copy link

@nicar Perfect! You're the best!
Thank you for fixing the add-on!

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

No branches or pull requests

3 participants