Dynamicsget Custom Where Clause Issue #1182

Closed
opened 2024-10-20 18:25:29 +00:00 by eciudad · 4 comments

Steps to reproduce the issue

he admin views work fine at the side bar. I have two site views. They have no extensive code, just a var_dump of the custom dynamicsget.
I create main menus for the site views and each one generate the following errors:
I looked debug all over, but I cannot fine anything there almost no coding of my own.

Expected result

Dump of raw data of the custom dynamicsget

Actual result

0 syntax error, unexpected single-quoted string "fatherstrees"
0 syntax error, unexpected single-quoted string "motherstrees"

after the above error:
I changed from var_dump in my Site View to:

sqldataf as $item): ?>
townerID; ?> tree_type; ?> childID; ?> cname; ?>

"sqldataf" is a Dynamicget Custom Get

On the Dynamicget
while on "Editing the Dynamic Get"
under "Tweak" tab
and under "Where" clause, there are, "Table Key*", "Comparison Operators*" and "Value Key*" input sections
in the "Table Key*" I selected a field named "a.tree_type",
in the ""Table Key*", "Comparison Operators*" I selected the choice"equal",
in the "Value Key*" I believe that here is what my issue is since the value of a.tree_type Table Key is a text equal to "F".

I have tried numerous combinations. Can someone tell me what is the syntax expected in the "Value Key*" section if the value is text or numeric?

Note: if I clear the "Tweak" tab I get the rows in the table which tells that I am entering the wrong syntax in the "Value Key*" section.

System information (as much as possible)

  • OS Name & Version: Linux lamp302.cloudaccess.net 3.10.0-962.3.2.lve1.5.85.el6h.x86_64 #1 SMP Thu Apr 18 09:46:51 UTC 2024 x86_64
  • MySql Version: 8.0.34-cll-lve
  • Apache Version:
  • PHP Version: 8.2.23
  • Joomla Version: Joomla! 5.1.4 Stable [ Kudumisha ] 27-August-2024 16:00 GM
  • JCB Version:
  • Browser: Microsoft Edge Version 130.0.2849.46 (Official build) (64-bit)

Additional comments

Can you tell what is the syntax? 'F', "F", $this->{value} or something to enter. I know that $this->userId works but I do not know what to enter if the value is a text or numeric. I watched the instruction videos, but I cannot find a reference

### Steps to reproduce the issue he admin views work fine at the side bar. I have two site views. They have no extensive code, just a var_dump of the custom dynamicsget. I create main menus for the site views and each one generate the following errors: I looked debug all over, but I cannot fine anything there almost no coding of my own. ### Expected result Dump of raw data of the custom dynamicsget ### Actual result 0 syntax error, unexpected single-quoted string "fatherstrees" 0 syntax error, unexpected single-quoted string "motherstrees" after the above error: I changed from var_dump in my Site View to: <table class="uk-table uk-table-hover"> <thead> <tr> <th><?php echo Text::_('Treeowner'); ?></th> <th><?php echo Text::_('Type'); ?></th> <th><?php echo Text::_('Child'); ?></th> <th><?php echo Text::_('ChildName'); ?></th> </tr> </thead> <tbody> <?php foreach ($this->sqldataf as $item): ?> <tr> <td><?php echo $item->townerID; ?></td> <td><?php echo $item->tree_type; ?></td> <td><?php echo $item->childID; ?></td> <td><?php echo $item->cname; ?></td> </tr> <?php endforeach; ?> </tbody> </table> "sqldataf" is a Dynamicget Custom Get On the Dynamicget while on "Editing the Dynamic Get" under "Tweak" tab and under "Where" clause, there are, "Table Key*", "Comparison Operators*" and "Value Key*" input sections in the "Table Key*" I selected a field named "a.tree_type", in the ""Table Key*", "Comparison Operators*" I selected the choice"equal", in the "Value Key*" I believe that here is what my issue is since the value of a.tree_type Table Key is a text equal to "F". I have tried numerous combinations. Can someone tell me what is the syntax expected in the "Value Key*" section if the value is text or numeric? Note: if I clear the "Tweak" tab I get the rows in the table which tells that I am entering the wrong syntax in the "Value Key*" section. ### System information (as much as possible) - OS Name & Version: Linux lamp302.cloudaccess.net 3.10.0-962.3.2.lve1.5.85.el6h.x86_64 #1 SMP Thu Apr 18 09:46:51 UTC 2024 x86_64 - MySql Version: 8.0.34-cll-lve - Apache Version: - PHP Version: 8.2.23 - Joomla Version: Joomla! 5.1.4 Stable [ Kudumisha ] 27-August-2024 16:00 GM - JCB Version: - Browser: Microsoft Edge Version 130.0.2849.46 (Official build) (64-bit) ### Additional comments Can you tell what is the syntax? 'F', "F", $this->{value} or something to enter. I know that $this->userId works but I do not know what to enter if the value is a text or numeric. I watched the instruction videos, but I cannot find a reference
Owner

you can not add strings in that area like 'F' or 'Root', this must be done with variables, I explained it in this issue #1181 as well.

Please read my comment there and let me know it that does not help...

you can not add strings in that area like 'F' or 'Root', this must be done with variables, I explained it in [this issue #1181](https://git.vdm.dev/joomla/Component-Builder/issues/1181#issuecomment-34628) as well. Please read my comment there and let me know it that does not help...
Author

Llewellyn,

$cftree = array("cffname" => "ROOT", "cfmtree_type" => "M", "cfftree_type" => "F");
$cftree["cffname"]
$cftree["cfmtree_type"]
$cftree["cfftree_type"]

I view the #1181

Can you give me a quick sample of what should be in the "Value Key*. Tried several things and I cannot get it to work.

Llewellyn, $cftree = array("cffname" => "ROOT", "cfmtree_type" => "M", "cfftree_type" => "F"); $cftree["cffname"] $cftree["cfmtree_type"] $cftree["cfftree_type"] I view the #1181 Can you give me a quick sample of what should be in the "Value Key*. Tried several things and I cannot get it to work.
Owner
$cffname = "ROOT";
$cfmtree_type = "M";
$cfftree_type = "F";

Like this (getListQuery):
image

Like this (getItem):
image

Then add them like this:
image

Side Note

The tutorial about the dynamicGet area is very helpful, you can either search it here or you can view it here

While these tutorials are old, the area has not changed and the features are only more stable.

``` $cffname = "ROOT"; $cfmtree_type = "M"; $cfftree_type = "F"; ``` Like this (getListQuery): ![image](https://git.vdm.dev/attachments/14164a47-a1fd-491f-85ec-93317ef5299a) Like this (getItem): ![image](https://git.vdm.dev/attachments/4b990ba0-36b0-4d22-a0ce-ba6cb9dae6e8) Then add them like this: ![image](https://git.vdm.dev/attachments/f0f3fdb4-2e28-4ed6-9c5f-f4928b9ded03) > Side Note The tutorial about the dynamicGet area is very helpful, you can [either search it here](https://git.vdm.dev/joomla/Component-Builder/wiki/013-dynamicGet) or you can [view it here](https://www.youtube.com/watch?v=OPuCoxPW35s&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE) While these tutorials are old, the area has not changed and the features are only more stable.
Author

Thank you, Llewellyn

Your examples helped me greatly. Excellent work!

The filter recommendation for the filtering-based on logged user did not work. I was getting records by the thousands. I used the "Where Clause" (see enclosed pictures) to filter the records for the logged user instead and the records pulled went from the thousands to 123. The system did not get stuck, and results displayed in about 3 seconds That is what I was looking for. Since I know the data, I was able to validate.

Now, I will continue to build the Site Views.

Thank you once again.

Elias

Now

Thank you, Llewellyn Your examples helped me greatly. Excellent work! The filter recommendation for the filtering-based on logged user did not work. I was getting records by the thousands. I used the "Where Clause" (see enclosed pictures) to filter the records for the logged user instead and the records pulled went from the thousands to 123. The system did not get stuck, and results displayed in about 3 seconds That is what I was looking for. Since I know the data, I was able to validate. Now, I will continue to build the Site Views. Thank you once again. Elias Now
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1182
No description provided.