New php_events plugin for Lists

Bauer

Well-Known Member
I think I found my new favorite plugin - (I forgot to install it after last few GitHub updates) - the php_events plugin.

But I'm lost as to how to use it! I can't find any documentation for it anyhwere - and the labels ahead of the code textareas don't help much at all.

What does OnFiltersGot and OnMakeFilters do?

I suppose my most urgent question would be - How do I add to an existing filter already set with the pre-filter? (Example?)
 
friendly bump ;)

So when is this run - and how does it work? (See last post):confused:

Nevermind - I just looked at the latest version (I updated from GitHub just this morning) and it now seems a bit more self-explanatory - (and with many more code options)

I'll post here if I have any problems.
 
I'm sure they'll be more, but...

How do I force Fabrik to refresh the values for the $my object (i.e. to re-query them from the #__users table)?
 
The $my "object" isn't actually an object. It's a notation we use for legacy reasons in placeholders, as that used to be the global logged on user object in J! 1.0.x, so we elected to retain that notation for placeholders.

Processing of the $my placeholder is done in the FabrikWorker::replaceWithUserData() method, in helpers/parent.php, where we already re-query J! each time round, using JFactory->getUser(), around line 509.

-- hugh
 
The $my "object" isn't actually an object. It's a notation we use for legacy reasons in placeholders, as that used to be the global logged on user object in J! 1.0.x, so we elected to retain that notation for placeholders.

Processing of the $my placeholder is done in the FabrikWorker::replaceWithUserData() method, in helpers/parent.php, where we already re-query J! each time round, using JFactory->getUser(), around line 509.

-- hugh
Do you remember my mentioning that most all lists/forms in my project are being filtered to userid, survey_id, and subscription_type?

Well I've been struggling with an easy way to access those three important values for the current user "globally" throughout Fabrik.

If you can come up with a suggestion for a better way of doing this PLEASE let me know...

After having my idea of a "carry-on" option added when creating new records scoffed - I turned to adding a few fields to the #__users table to track those values for each user.

I thought that by doing that, and using the $my placeholder, I had a solution. It seemed to work, but there was one instance where I was using the new php_events plugin - and the user survey_id gets changed in the #__users table - and yet that change was not immediately reflected in the $my->survey_id value. (That's why I asked this question.)

I know all about the dangers of modifying core Joomla files - but I don't touch the standard fields in #__users - and so far this seems to be working for me. Whether some other part of Joomla, or a 3rd party extension, doesn't like what I did - I have yet to find out.

I can't come up with any other solution. I think I initially tried using $_SESSION variables - but that was not very reliable and was getting lost between sessions.

So PLEASE don't get rid of the $my placeholder, no matter how outdated it is, it's great to use in places in Fabrik where you can't use JFactory::getUser().

OR maybe there could be a Fabrik "global" array variable (placeholder) unique to each user that would allowed storing that sort of info in memory (and a table) for each user session (and wouldn't require altering the #__users table)?
 
Please show me where Rob or I "scoffed" at your suggestions for persistent data.

This is something I've been trying to get through to you since the very first post of yours I saw, where you talked about us not being "bothered" to respond. Your overly aggressive, combative and abrasive style distracts from the actual content of your posts. I can't think of any area of life where it's OK to exhibit your kind of attitude when asking people to devote free time to solving your issues. And then act surprised when people don't jump right on solving your issues.

FYI, I have been giving quite a lot of thought to the 'persistant data' issue, not just for your requirements, but as something which I've run across the need for in several projects. But it's not something I can just whip up on the spot. It needs a lot of thought, and some very careful coding.

We do currently have one mechanism which may be helpful, which is the user_defines.php. if you look in ./plugins/system/fabrik, you'll see a defines.php. If you copy that to user_defines.php, you can then extend it with your own code. This file gets run at the start of EVERY J! page load, as a system plugin, so you have to be careful about the load you put in there. But it could certainly be used to (say) check the session data, and if necessary read per-user data from a table, and load it into session data, which could then be used in most strategic places in Fabrik (like in list pre-filters, using eval'ed values).

[NOTE - remember that user_defines.php must EXTEND the code already in defines.php, i.e. copy defines.php, and add to it, do NOT alter the existing code in any way, shape or form!]

We don't publicize this mechanism much, as it is kind of dangerous, and one slip can break your entire site. So I'd recommend using things like try / throw / catch exception handling around any code that might conceivably generate any PHP errors.

Meanwhile, I'll continue to think of a better, less potentially dangerous way of handling this requirement.

-- hugh
 
I think my biggest problem is struggling to learn all there is to learn. This project is a bigger monster than anything I was ever involved with - and I don't mean that in a derogative way - I just mean it is huge, and there are a lot of things I feel "stupid" about even asking. Because usually, developers will get sick of answering the same old stupid questions and just scream RTFM! That is one thing I have to give you guys credit for - you seem to "be there" for questions that have been asked dozens of times.

Despite my being a cranky old man, I still really feel for any developers because I know exactly what it's like to be working to appease customers and still have to keep your cool. So I should really apologize for pushing buttons like I do. I have a dog and cat but wouldn't think of raising a hand or swift foot to either of them - yet sometimes I need a punching bag. I'm sorry that sometimes I make that of you.:(

I have 3 or 4 major issues with my project that are still unresolved. I find myself doing more work to "work around" them, and it gets frustrating - but it's either that or remain stagnant as far as going forward with development in other areas. Maybe after I meet with the client Monday I will have a better understanding of what she considers critical and what might be trivial to her. (Right now, in an email, she is concerned with the "looks" of the website, and I keep telling her that is the least of my worries.)

I should just walk away and sleep on this project a few days. That always helps clear my mind and sometimes brings a solution I never thought of before.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top