1283 Posts
Bucklash
5 years ago
3
Topic

Hi folks

My query works as required on ordinary field ie art_id but not break field

I am using SEBLOD Break plugin.

The query I am using is this (as output via Joomla! debug), as you can see, the query works

OUTPUT (as seen in Joomla! debug)

Rows returned: 1
SELECT member0.id AS value
FROM omgni_users AS member0
INNER JOIN omgni_map_invoice_student AS map
ON member0.id = map.many_id
INNER JOIN omgni_map_invoice_session AS map2
ON map.one_id = map2.one_id
WHERE map2.many_id = 1100 // Dynamic value: $cck->getValue('art_id')
AND map.many_id = 441 // Dynamic value: $user->id



INPUT (Restriction/4 in Search Item View as SQL Query on Break Plugin)

SELECT member0.id AS value
FROM #__users AS member0
INNER JOIN #__map_invoice_student AS map
ON member0.id = map.many_id
INNER JOIN #__map_invoice_session AS map2
ON map.one_id = map2.one_id
WHERE map.many_id = $user->id
AND map2.many_id = $cck->getValue('art_id')

However....

  • No matter what I try it just Breaks (invert is ineffective)...
  • If I substitute...

    • $cck->getValue('art_id') for 1100 (my test article)
    • $user->id for 441 (my test user)

  • ..., then it works, if the values are dynamic it seems to not work even though it has the correct values ...
  • ... The debug query shows that I am actually retrieving dynamic values, it just does not seem to like them

Any suggestions?

Get a Book for SEBLOD
1283 Posts
Bucklash
5 years ago
2
Level 1

Playing around further.... I see nothing really works for me

If I make 

  • Restriction: Fields
  • Property: Value
  • Field Name / Value(s): art_id
  • is Equal/In
  • Default
  • 1100

Then this breaks everything, even the article with art_id of 1100

And ot confirm, the first field in the Item View is Art ID, the second is Break

1283 Posts
Bucklash
5 years ago
1
Level 2

The issue seems to be the Restriction...

If I apply the Restriction SQL Query to a normal field, it works fine i.e. the field shows depending on query, and invert has effect, too

Apply it to the Break field, it breaks no matter what.... hmmm

1283 Posts
Bucklash
5 years ago
0
Level 3

As a work around which works great for my situation (I am using Item View for Lists)

  • I apply the query to the restriction of my art_id field
  • In my position override I have this:
<?php
// RESTRICTION if (!$cck->renderField('art_id')) { return; }
Get a VIP membership