Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] 500 - An error has occurred. joomla user in filter

500 - An error has occurred. joomla user in filter 23 Aug 2013 16:03 #10901

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi Admin,
Another one for you...
(I :lol: as Admin says :angry: "not him again he always finds something wrong")

In my downloaded component
- When Creating Menu Item and setting menu item filters
- if the Joomla user field is set is in the filter you get the following in the modal select window

500 - An error has occurred.
View not found [name, type, prefix]: users, html, mytasksView

Return to Control Panel

Same as here www.j-cook.pro/index.php/forum/closed-ti...-more-than-one#10630

I know you mentioned the issue of access to sandbox user list could be a major issue i guess this is very much related
Last Edit: 23 Aug 2013 16:03 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

500 - An error has occurred. joomla user in filter 23 Aug 2013 16:26 #10904

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Just to add to ticket and extend a little further something from one of my other posts

can i suggest to have an additional option in the menu filters
- the current user (if its not already done)

Have not tested below code but should be close to what is needed
SELECT 
a.name AS 'name'
, if(a.id = (int) JFactory::getUser()->id  , "CUID", a.id) AS 'ID' // values for id column
, if(a.id = (int) JFactory::getUser()->id  , "Current User", a.username)  AS 'username' // values for username column
, if(a.id = (int) JFactory::getUser()->id , "a.id = (int) JFactory::getUser()->id", a.id ,  'filter.' . $fieldname . 'text' ) AS 'filtertext' // the default value for setState('filter.somefield')
FROM #__dbprefix_users AS 'a'
WHERE a.id=the_filter_id_selected 
OR a.id=(int) JFactory::getUser()->id

This would then display a list like
IDnameusername
1Alexander Adminmr.admin
2Elizabeth Editormrs.editor
3Mary Managermiss.manager
4Garry Guestmr.guest
CUIDCurrent Usercurrentuser

the filtertext field needs to take into account the current field as you can have multiple instances of Joomla User field
such as created_by, modified_by, my_juser, my_juser_wife, my_juser_brother...
hence the code
'filter.' . $fieldname . 'text'

This would allow practically all filter fields of juser to be set to the current user

an example would be

show all records
created by me OR modified by me OR checked out by me
AND WHERE Freds brother is me OR Marys brother is me

....
i think you get the picture

but this would also mean you could show more complex scenarios

As always just another thought
Last Edit: 23 Aug 2013 17:55 by BTB300.
The administrator has disabled public write access.

500 - An error has occurred. joomla user in filter 23 Aug 2013 18:24 #10905

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Just To Add to this again

When Creating the Menu Item
the menu item filters need to have the associated database field name...

Under Requirements i have 4 filters displayed as below

REQIUREMENTS
Select Componentselect component dropdown comboSELECTCLEAR
Select Categoryselect category dropdown comboSELECTCLEAR
Select Usersselect users dropdown comboSELECTCLEAR
Select Usersselect users dropdown comboSELECTCLEAR

Can not tell which one is modified_by or created_by

Should Be displayed as
REQIUREMENTS
Select Componentselect component dropdown comboSELECTCLEAR
Select Categoryselect category dropdown comboSELECTCLEAR
Select modified_by Usersselect modified_by users dropdown comboSELECTCLEAR
Select created_by Usersselect created_by users dropdown comboSELECTCLEAR

And the associated info text when you hover on Select users displays as

Select Users
Select Users

Needs to specify the field name as well
Select modified_by Users
Select modified_by Users
Last Edit: 23 Aug 2013 18:25 by BTB300.
The administrator has disabled public write access.

500 - An error has occurred. joomla user in filter 26 Aug 2013 10:35 #10908

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Ok, right.
I am currently working on this.
Coding is now a piece of cake
The administrator has disabled public write access.

500 - An error has occurred. joomla user in filter 26 Aug 2013 13:07 #10910

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Fixed.
Should be better now.

But still not available the option to auto filter with the current logged user.
This option is very good and I am gonna do it.
But remember that those params are sent by URL so it is not a security filter !

For layouts which needs a secure filtering, use PHP and authoring.
Coding is now a piece of cake
The administrator has disabled public write access.

500 - An error has occurred. joomla user in filter 26 Aug 2013 16:14 #10911

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Now I have added the ability to select automatically the current user.

It have been a hard work, but very important.
Can you tell me if I have answered your ticket ?
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: BTB300

500 - An error has occurred. joomla user in filter 29 Aug 2013 18:13 #10929

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
admin wrote:
Can you tell me if I have answered your ticket ?
Testing Now...
The administrator has disabled public write access.

500 - An error has occurred. joomla user in filter 29 Aug 2013 18:56 #10930

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Wonderful
- Fixed !!!
- AND A new functionality can be listed for COOK 2.5

I am sure that you will get many thanks from everyone that has been waiting for the the long awaited "My View"

The road map is long but you just ticked another task off your list

Thank you for your continuous support and development we used to say that Cook was evolving but now it think we can say its "hatched"
K++
Last Edit: 29 Aug 2013 18:57 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

500 - An error has occurred. joomla user in filter 29 Aug 2013 19:03 #10931

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
And thank to your wonderfull debuging help as well.

When I have time I'll put you a badge "Better tester" on your forum profile.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: BTB300
Time to create page: 0.081 seconds

Get Started