10 years ago
20
Topic

Greetings,

I have purchased the dynamic cascade plugin and I can use the construction option to get my lists to appear correctly in my form. However, when I save, I get an Unknown Column error. It appears to be taking the value selected on the end select and trying to locate a column by that title as opposed to a content by that title. I have no idea how to do a free query that works with the parent so that I can do this, so I was hoping someone here could help me out. My select is very simple.

Start Dynamic Cascade: story_author

End Dynamic Cascade: series_title

Table Name: ehc_cck_store_form_series

I need the query to give me a distinct list of series titles based on the story author. I've gone through the documentation on this plugin and searched for vids, but the ones that reference this specific field aren't in English. I would appreciate any help you can provide. I found another forum post where someone was asking about the free query as well, but I didn't understand what he was saying about the parent linkingfield. Did he create a new field and then join tables? That's beyond me. I'm no coder. I followed the seblod documentation to the t, but still get this error when I save. 

Cheers!

Merkin

Get a Book for SEBLOD
4229 Posts
Kadministrator
10 years ago
2
Level 1

Hi,

this highly depends on your tables, are story_author and series_title both located in ehc_cck_store_form_series table? 

This sounds incorrect, select dynamic cascade works in a way that one dropdown usually pulls values from one table, then second one pulls values from second table, but with some field linking it to the first dropdown, this is what gets in the parent setting. So in your case, if you have authors in one table with id column as identifier, you should have something like author_id in the second table, and parent in second select would be author_id. Then selects would first list a list of authors, when one is selected, second dropdown would only list stories that have matching value in the authour_id column.

10 years ago
0
Level 2

Thanks for getting back to me, Klas! Yes. The story_author field is one I built that stores the value of the currently logged in user in the form table where the series_title is stored as well. Both are put into the table upon saving. So, it needs to be pulling from a separate table for each dynamic option? I'm not sure how I would do this with the story author. I supposed I could use the ehc_users and look for the username? 

10 years ago
0
Level 2

Klas, just to let you know, I used two tables linked by the story_author and got the same error. Here it is:

Unknown column 'meloveslu' in 'where clause' SQL=SELECT story_author,story_author FROM ehc_cck_store_form_series WHERE story_author IN (meloveslu)

meloveslu is an author name that I tested at random. The list populates correctly in the form, but when I save, this error pops up. For this trial I used two tables, linking them by the username. Any other ideas?

4229 Posts
Kadministrator
10 years ago
6
Level 1

First select needs to be puling from ehc_users table and have User - username set as live value. In second one you select story_author column from

ehc_cck_store_form_series and set username as parent. Parent is column from first table that will be matched against your story_author column.

P.s. your above query does not work as meloveslu is recognized as column by mysql, you would need to use 'meloveslu' (in single quotes)

10 years ago
0
Level 2

Every time I try to reply, the site boots me off... 

10 years ago
4
Level 2

Okay, so I tried what you said:

"First select needs to be puling from ehc_users table and have User - username set as live value."


"In second one you select story_author column from ehc_cck_store_form_series and set username as parent. Parent is column from first table that will be matched against your story_author column."


RESULT:


In regards to your note about the error I posted, I'm using construction, not free query, so how could I change that? I know that I'm missing something really small and ridiculous here, but I just can't seem to figure it out. I can get the lists to populate just like they should, but saving gives me this error and I'm not sure what the free queries should look like. I appreciate your attempts to help. There has to be a way.
Cheers!
Merkin

10 years ago
3
Level 3

Sweet, third time's a charm. Here are screenshots, Klas. I did what you said, and I think the reason that it doesn't work is because the username column isn't present in the ehc_cck_store_form_series table. However, the username values are saved to the story_author column. Again, I can get the form lists to populate, but get that unknown column error. I hope you can see what idiot mistake I'm making. Thanks again!

4229 Posts
Kadministrator
10 years ago
2
Level 4

Hi,

I did a little mistake here, you need to set story_author as parent in second one (it needs to be column name where row matching first selects value can be found) , but also your Options name and value are wrong in second one, judging by your first post it needs to be series_title

10 years ago
1
Level 5

Okay, that's how I had it to get the error. Just to confirm, here is what you are instructing:

I left the first step alone.


The second one, as you instructed...


It works on the form, which is great.


But, same error...


I still don't understand what I'm doing wrong. Any other thoughts?

10 years ago
0
Level 6

Bump

4229 Posts
Kadministrator
10 years ago
1
Level 1

Hi,

this actually looks like a bug in the plugin that expects parent value to be numeric.I'll test and report back. If you don't have a lot of data in the database you could redo the series form to use user ID (author_id in the numeric form, not string) , instead of username as workaround.

10 years ago
0
Level 2

Hm, there are about 500 entries that I'd have to change and that would also require a new hidden field for comparison. It's at least good to know that I'm not crazy. lol Do you think that a fix would be coming quickly? If not, I'll take the time to restructure my stuff. If it's a quick fix, I'd rather not. Thanks for helping with this, Klas. I really appreciate you!

10 years ago
0
Level 1

Okay, I set it up using the user ID. Here are the results:

First Cascade


The second one, now using the user_id:


It works on the form, which is great.


But, new error...


I still don't understand what I'm doing wrong. Any other thoughts?

10 years ago
1
Level 1

Sorry about that, let's try again. Okay, I set it up using the user ID. Here are the results:

First Cascade


The second one, now using the user_id:


It works on the form, which is great.


But, new error...


I still don't understand what I'm doing wrong. Any other thoughts?

4229 Posts
Kadministrator
10 years ago
0
Level 2

In the first dropdown you can continue to use user name as Options Name (or keep ids, your choice, but Options Value needs to be id in any case).

To get around this second issue you will need to use something like series_id or just id as "Options Value", of course your table needs to have this id coulmn.

10 years ago
0
Level 1

bump

10 years ago
1
Level 1

Any thoughts yet?

10 years ago
0
Level 2

Greetings,

I know that you guys do a lot and for free. I could really use some assistance with this plugin as I purchased it for this express purpose. I hope you can get back to me soon.

Cheers!

Merkin

10 years ago
0
Level 1

Another bump. 

4229 Posts
Kadministrator
10 years ago
0
Level 1

Fixed version of the plugin main file, that works with strings as vlaues can be found on the tracker

http://www.seblod.com/resources/tracker/13252

Get a Book for SEBLOD