• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Check submissions on submit

OK, first problem was that you hadn't (as per my first post) "changed the element names to suit", you were using the wrong element name. Your full element name is tva25_fb_registration___registration_date_id, not registration___registration_date_id. I should maybe have been more specific. But whenever refering to elements in Fabrik with the ___ separated style of tablename___elementname, you can always look at your main list of elements, and see / copy that.

Second problem was that you had a space inside that quoted name, 'registration___registration_date_id ', which is somehting you have to be very careful about in any programming language, spaces are significant!

Third problem was you'd taken me a bit too literally and removed the 'return' from the last line logic, rather than just changing the logic, so the script wasn't actually returning any value.

Fourth problem was on me, I forgot a line of code as the second line, to turn that data into a simple value instead of an array.

Anyway ... it now makes it through to the end of the code, and I can var_dump() out the values.

However, I have no idea what values I need to use on the form to test for a fail. If you can tell me what I need to put to a) have a submission pass and b) have a submission fail, I can actually test it.

NOTE - I had to disable the 'not empty' validation on that element to test the PHP.

-- hugh
 
OK, for the first example, here's what the debug I have in there is putting out:

PHP:
var_dump($registration_date_id, $query1, $query2, $max,$total);exit;

string(2) "41" string(78) " SELECT COUNT (*) AS total FROM registration WHERE registration_date_id = '41'" string(64) " SELECT registration_max FROM registration_dates WHERE id = '41'" int(0) int(0)

... so the $registration_date_id is 41. Looking that up in the registration table (that first query) is getting 0. As is looking it up in the registration_max table.

So you need to work out why those queries are failing to come up with the numbers they should. They probablky aren't looking at the right field in the WHERE. I just don't understand your table structure or what should be where, so I can't correct the queries. But you should be able to work it out from this info, and correct the queries.

Once you have the right queries and numbers you expect, just remove that var_dump line.

-- hugh
 
Thanks for your work!

But after I have struggled some hours, I can't get this check to work. I have done the modifications I thought would work, but they don't. Below I have the involved Fabrik elements, so it would be great if you could help me out.

Fabrik elements for the table/list with dates for registration:
tva25_fb_registration_dates___id
tva25_fb_registration_dates___registration_max

At the registration form, Fabrik element joined to table/list with registration dates:
tva25_fb_registration___registration_date_id

This element is used for check:
tva25_fb_registration___workgroup

Regards
Matt
 
Friendly bump

I have simplified things a bit, no prefilters for lists. So from frontend (Joomla), just start at "Start registration" to test the check of max submissions.

Matt
 
OK, I'm back to not being able to log in to your site. If you need me to work on it, you need to enter the details in to your My Sites list, which is still empty. I can get to the site, but for whatever reason my LastPass doesn't remember the login details, and I can't find wherever it was you gave me the details.

So please, fill out your My Sites with the URL, username and password.

http://fabrikar..com/you/my-sites

-- hugh
 
Ah, I see the problem. Because you didn't enter a site name, only login credentials, it's not showing on your "postbit" (the details to the left of all your posts). We see a special section there, which shows us your site URL, which is a clickable link, and has your credentials as a popup tooltip. Which is what we use for getting to you site. But because you didn't enter a site name, there's nothing in the A tag, so I don't see a site listed.

Can you go and enter your site URL in My Sites, so we don't have to go searching through this thread to find it? Anything you can do to make things quicker and easier, increases the time we can spend working on your site!

-- hugh
 
OK, can you go and test in phpMyAdmin, or whatever database utility you use, and see why this query:

Code:
SELECT COUNT (*) AS total FROM tva25_fb_registration WHERE registration_date_id = '43'

... is coming up with 0 instead of 2 or 3.

-- hugh
 
I have tested with phpMyAdmin and have the count = 3
But that is after some tweeking with the code. I deleted a space before (*).
Code:
SELECT COUNT(*) AS

I also made the change at my site, and I think i works now :)
 
After some testing of your check, it seems to work fine. I only moved the check to a hidden element (date_time) in the form to not confuse the user at error with this check.

Thanks
Matt
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top