Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

FK not removed from filter 12 Aug 2012 09:21 #3107

  • BTB300
  • BTB300's Avatar Topic Author
  • Away
  • Moderator
  • Moderator
  • Posts: 415
  • Thank you received: 132
Hi
I had a table called Groups
The foreign key was a lookup to the same Groups and the field was called group_id
An admin Collection layout was created with a filter that used the group_id field

Later i decided that i no longer needed the FK / lookup field group_id

i deleted the FK from the groups table - the object was removed from all layouts as expected

But in the in the admin collection layout the group_id filter remained (was not removed on delete from table)

Symptoms
- when the table had no filtering applied => all records were displayed
- the undeleted group_id filter dropdown listed => all values displayed
- when the user selected the group_id filter value from the dropdown list => no record was displayed (auto submit checked)

Resolution
The FK group_id was removed from the table but not the filter
could not display the selected record because the group_id field was no longer present in the table
deleted the group_id filter

The filter then worked as expected.

Unsure if its a bug or if its just a one off issue where the delete script did not complete but just thought i would let you know...

Please Log in or Create an account to join the conversation.

Last edit: by BTB300.

Re: FK not removed from filter 12 Aug 2012 09:33 #3108

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Yes you are right, I know this one.

The broken informations are in the properties only.

The problem came from the fact the properties are stored in a JSON string. And when you remove a FK that has been used as group by property (for example), the group by properties behind to this removed FK are still present. The cascad deletion can not work because of the JSON string which is impossible to search in.

It is a big deal for me.

It do not create a fatal at the building, or in your generated component.
But I know it is really problematic.
This ticket will remain open a while for the moment I don't have any easy solution.

KEEP IN MIND :
Removing the FK can create issues in the properties of objects where this FK has been used.
-> Group by properties of Form > FK
-> Group by properties of Filters > FK
-> Group by properties of Grid
Coding is now a piece of cake
The following user(s) said Thank You: BTB300

Please Log in or Create an account to join the conversation.

Last edit: by admin.
  • Page:
  • 1
Time to create page: 0.058 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started