Fabrik Home

Go Back   Fabrik > Fabrik 2.0.x > Bronze Subscriber Support


Notices

Bronze Subscriber Support This is the monitored support forum for Bronze Supporters. Although we do our best to answer all posts in Bronze support on a FIFO basis (First In, First Out) every day, sometimes we simply don't have the time to get to everyone. We leave it up to you to keep your issues on our radar! If you haven't received a response within one working day, it is likely that you will need to "bump" your thread (by posting a short, polite follow-up saying something like "friendly bump"). It also helps everyone if you remember to close your threads once they are resolved (using the Thread Tools menu). You can always re-open them later if need be.

Reply
 
Thread Tools
Old 07-30-2010, 11:43 PM   #1
mygunfriday
Member
Supporter
 
Join Date: Nov 2009
Location: Winnipeg, MB, Canada
Posts: 57
Thanks: 10
Thanked 2 Times in 2 Posts
mygunfriday has helped a few Fabrik users
Default Calculation Element Problem with Calc on Save Option

I'm sure I had my Calculation Elements working before, but now they won't pick up {tablename___elementname} data from other fields on the form on a New Form submit.

It works if I've already submitted data and return to the form and save again, but I thought I could access the newly created element values in the calculation element and save those as well in a New Form submission.

Can someone set me straight on this?

Cheers,

Jeremy

mygunfriday is offline   Reply With Quote


Old 07-31-2010, 07:07 AM   #2
peamak
Senior Member
 
peamak's Avatar
 
Join Date: Dec 2008
Location: Biarritz, France
Posts: 2,031
Thanks: 151
Thanked 281 Times in 245 Posts
peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God
Send a message via Skype™ to peamak
Default

Can you show us your code to see if there's something obviously wrong?

When you say "now they won't pick up......": what happened exactly before "now", did you update Fabrik?
__________________
-- tom

SVN - Get the plugins
Nightly builds
Fabrik tutorials
HowTo List
Donate (to Fabrik, not to me )
peamak is offline   Reply With Quote
Old 08-01-2010, 12:14 AM   #3
mygunfriday
Member
Supporter
 
Join Date: Nov 2009
Location: Winnipeg, MB, Canada
Posts: 57
Thanks: 10
Thanked 2 Times in 2 Posts
mygunfriday has helped a few Fabrik users
Default

Quote:
Can you show us your code to see if there's something obviously wrong?

When you say "now they won't pick up......": what happened exactly before "now", did you update Fabrik?
__________________
-- tom
Hi Tom,

I've attached one actual sample where the query works fine if I use it with no save selected (results show in the table for all records), but fails to display on new if yes is selected (no result in table).

I did a simpler sample with just a "return '{tablename___elementname};'" from the same table which again works (displays in the table) if no save is selected, but fails to save a value if yes is selected.

I've attached some screenshots of my settings used.

I had been working on a complicated form that will have multiple forms pointing to the same table, I noticed this wasn't working as I expected, but didn't realize it had also stopped working in other forms I'd already completed and tested. I did a Fabrik update yesterday to see if that would help, but no luck.

Aside from that, I'm running on a Rochen server and I had some problem with accessing the email templates I'd made in Joomla articles because of the access level setting in Joomla - I don't know that I've changed anything else, but I may have done something...

I should mention that while Save is on yes, this also doesn't work on a new record or an edit of an existing record at this time, though I'm sure yesterday, it was working if I did an edit.

Any help would be much appreciated...

Jeremy
Attached Images
File Type: png calc_elem_tax_nosave_sample.png (80.0 KB, 8 views)
File Type: png calc_elem_tax_saved_sample.png (80.0 KB, 8 views)
File Type: png calc_elem_test_saved_sample.png (62.8 KB, 8 views)
mygunfriday is offline   Reply With Quote
Old 08-01-2010, 09:41 AM   #4
peamak
Senior Member
 
peamak's Avatar
 
Join Date: Dec 2008
Location: Biarritz, France
Posts: 2,031
Thanks: 151
Thanked 281 Times in 245 Posts
peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God peamak is a Fabrik God
Send a message via Skype™ to peamak
Default

I'm not sure to understand why it's not working as you want but I just want to clarify something:
The option is "Calc on Save only: Yes/No" not "Save: Yes/No". I know the difference sounds trivial but still, it's different
__________________
-- tom

SVN - Get the plugins
Nightly builds
Fabrik tutorials
HowTo List
Donate (to Fabrik, not to me )
peamak is offline   Reply With Quote
Old 08-01-2010, 09:37 PM   #5
mygunfriday
Member
Supporter
 
Join Date: Nov 2009
Location: Winnipeg, MB, Canada
Posts: 57
Thanks: 10
Thanked 2 Times in 2 Posts
mygunfriday has helped a few Fabrik users
Default

To clarify:

If I choose: Calc on Save = No, then it works as expected
If I choose: Cac on Save = Yes, then it does not work
mygunfriday is offline   Reply With Quote
Old 08-02-2010, 04:51 PM   #6
rob
Administrator
 
rob's Avatar
 
Join Date: Jan 2007
Location: La Rochelle France
Posts: 9,628
Thanks: 131
Thanked 437 Times in 413 Posts
rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God
Default

have you tried setting you code to output some debug information, somehting like:

PHP Code:
$db->setQuery('your query here');
echo 
$db->getQuery();
echo 
'<pre>';
print_r$(_POST);
exit; 
are you sure the datbase join element whose data you are getting is visible and editable by the user?
rob is offline   Reply With Quote
Old 08-02-2010, 07:11 PM   #7
mygunfriday
Member
Supporter
 
Join Date: Nov 2009
Location: Winnipeg, MB, Canada
Posts: 57
Thanks: 10
Thanked 2 Times in 2 Posts
mygunfriday has helped a few Fabrik users
Default

Hi Rob,

I tried the debug code sample (screenshot attached). The form doesn't do anything on posting, it just posts as usual, with the calculation field empty.

Quote:
are you sure the datbase join element whose data you are getting is visible and editable by the user?
In the example, the city is a dbase join field selected by the user in the same form. The lookup in the calculation uses the _raw value from this selection to pull another bit of field data from the city table. So it is both visible and editable by the user.

I would have thought that the form itself would have access to all the data, even if I was hiding a field to lookup some data related to the user and using this hidden data to add another looked up value in a hidden field - is this not the case?

- Jeremy
Attached Images
File Type: png calcsample01-save.png (82.1 KB, 4 views)
mygunfriday is offline   Reply With Quote
Old 08-04-2010, 02:59 PM   #8
rob
Administrator
 
rob's Avatar
 
Join Date: Jan 2007
Location: La Rochelle France
Posts: 9,628
Thanks: 131
Thanked 437 Times in 413 Posts
rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God
Default

Quote:
The form doesn't do anything on posting, it just posts as usual, with the calculation field empty.
Are you sure you are editing the element which is associated with the form? I tested this and adding the exit; will definately stop the validation code and show any output you have echo'd out.
rob is offline   Reply With Quote
Old 08-04-2010, 09:39 PM   #9
mygunfriday
Member
Supporter
 
Join Date: Nov 2009
Location: Winnipeg, MB, Canada
Posts: 57
Thanks: 10
Thanked 2 Times in 2 Posts
mygunfriday has helped a few Fabrik users
Default

Hi Rob,

I double checked this, and I thought maybe the code had an error and was being ignored - so I rewrote it to something simpler. It now fails to display the form and displays a blank screen.

Now using this code:
Code:
$query = "SELECT tax_rate FROM cities WHERE id = 1";
$db->setQuery($query);
echo $db->getQuery();
echo '<pre>';
print_r($_POST);
exit;
So still not working as expected....

- Jeremy
mygunfriday is offline   Reply With Quote
Old 08-05-2010, 08:13 AM   #10
rob
Administrator
 
rob's Avatar
 
Join Date: Jan 2007
Location: La Rochelle France
Posts: 9,628
Thanks: 131
Thanked 437 Times in 413 Posts
rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God rob is a Fabrik God
Default

you would needd

Code:
$db =& JFactory::getDBO();
at the beginning, also its best when testing a site to put the error reporting (global config->system) to maximum to catch any php generated errors.
rob is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing problem with calculation element j37h3r Bronze Subscriber Support 8 06-03-2010 06:47 PM
Calculation Element Problem? DesoWV Bronze Subscriber Support 3 05-14-2010 02:49 AM
fabrik calc : disable calculation on edit black.be3 Community Support 2 06-05-2009 07:30 PM
problem installing calculation element plugin rouleau Bronze Subscriber Support 2 05-19-2009 06:05 PM

» News
Fabrik 2.0.1 released
Please read this blog... [Read More]
Fabrik 2.0 stable released
Please read this ... [Read More]
» Unfuddle SVN
Project: Fabrik 2.x
Rev Comment
4047 fixed <= / >= url filters were incorrectly quoting numeric values
4046 changed: table group by dropdown in admin now allows you to select the raw version of the element
4045 added: table option to deleted joined data when deleting records fixed: several xhtml strict/css validation issues
4044 fixed: using user element in non default connection, any prefilter set up to use said element would generate an SQL error
4043 changed: db join element's concat statement now run through parsemessageforplaceholder()
4042 fixed: email form plugin. Generated error if sending from admin whilst using an article template
4041 fr-FR admin language file: element plugin - fabrikgooglemap
4040 added: digg & rating elements now work with js turned off fixed: some xhtml strict validation errors
4039 fixed: incorrect quoting of dbjoin table filter autocomplete hidden fields
4038 changed: plugin controller - pluginAjax() - now allows for noajax=1 where by $app does redirect (allows for use of ajax...
Powered by vBadvanced CMPS v3.0.0

All times are GMT. The time now is 02:34 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios