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

Fix check_resid_tv behavior #377

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

udovichenko
Copy link

Hi,

I found that check_resid_tv option was not working as expected.

Expected behavior

I expected that when check_resid is set to @TV and check_resid_TV value is falsy (0 or empty), migxdbTV grid will show all existing items without checking if it is connected to current resource id.

Problem

In my project with such setup, function checkForConnectedResource was always returning true, and page with falsy check_resid_TV showed none items.
I found out that in old code $check_resid is never falsy, because it can be set to (falsy) $check only if $check is truthy.

Solution

After proposed changes migxdb grid in my project works as expected:

  • Shows all items when check_resid_tv is falsy in current resource
  • Show only items, that are connected by resource_id, when check_resid_tv is truthy

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 this pull request may close these issues.

1 participant