it was working fine the past few weeks but i have no idea what happened...
Every time I submit it gives me user_product_id cannot be blank.
<?php echo $form->dropDownList($model,'user_product_id',
CHtml::listData(Product::model()->findAllByAttributes(array('store_id'=>$store_id)),'product_id','product_name'),
array('prompt'=>'Select Your Product'));
?>
Not sure if this is related to the same problem, but within the same controller, it also gives me an error saying trying to get non-object, when it is an object.
$model->target_id = Product::model()->findbypk($product_id)->name_id;
var_dump gives me an integer for $product_id as well as the entire expression...
Related
I'm using Gravity PDF and have a Nested field from Gravity Perks. I can view fields in the normal exploded results just fine, but am having trouble when I want to display the Nested field in a particular location using the PHP option.
To be clear, I can get the normal $form_data['field'] and $form_data['list'] options to work just fine. But when I try to get one of those to fire a Gravity Form Nested Field I have issues. I've used a lot of combinations...
<?php echo $form_data['field'][27.72]; ?>
<?php echo $form_data['gpnf'][27]['gpnf']; ?>
<?php echo $form_data['field'][27]['gpnf']; ?>
<?php echo $form_data['field']['gpnf_display_value_27_72']; ?>
Thoughts?
Got it! Got it working earlier today and been fiddling with it all day. Just had to setup an API. First you use the original $form_data to get the Entry_ID
$client = $form_data['field'][32];
Then you point the API to the form_id you want:
$form_id2 = '27';
$entry2 = GFAPI::get_entry( $client );
And then it was a really easy variant of the rgar:
You need to setup $form_id2 and $entry2 or something like that because if you don't it changes the other ones in the PDF that are pointed at the original Form.
From here I've been able to customize the heck out of it.
Don't know the answer, but I use gravity forms and perks, and the perks support is really good and usually get back quickly with a response. Might try emailing them if you haven't already.
I'm very new to OpenRefine, so please bear with me if i have made a simple mistake.
I'm parsing a HTML website to gather some date.
Everything went fine with fetching the individual pages, but now the parsing of the HTML fails.
I'm creating a new column, based on the one holding all the page's HTML. I'm trying to get to the data in a specific DIV[20].
In the"create column based on this column" window it gives me a preview when using value.parseHtml().select("DIV")[20] , which results in exactly what i need... executing it gives me nothing but blank cells.
it even tells me that it is "filling 0 rows with grel:value.parseHtml().select("DIV")[20]"
Any clue what i'm doing wrong here?
You just need to finalize with .toString() to output the JSON.org object AS a string.
This is explained on our wiki here: https://github.com/OpenRefine/OpenRefine/wiki/StrippingHTML#extract-html-attributes-text-links-with-integrated-grel-commands
I also updated the select() function with that example: https://github.com/OpenRefine/OpenRefine/wiki/GREL-Other-Functions#selectelement-e-string-s
I have a rails app and when I have both the console and db:console open, they have different values for what is supposed to be the same field. I am using the send function to change the value. Here is the method in the model:
def toggle_approve(field)
self.send(field)
if(self.send(field).blank?)
self.send(field + '=', "new_value")
puts self.send(field)
else
self.send(req + '=', "")
end
rank.save
end
In my db:console (sqllite) everything is always correct, but in my regular erb console it is wrong. My view will then show what is in the erb console and not the sqllite. I dont understand what is going on in the background that would causing this issue. Any help would be great.
It's hard to be sure from the details you provided, but I think it is the case that your view uses an obsolete version of the data. Try calling .reload on the updated record, just at the point after the update and before presentation. See if that fixes your problem.
I'm working on a buddypress site in which members are allowed to post an ad that appears in the member directory, provided they also set an expiration date for it. Both fields are just Extended Profile Fields; the ad is a text area and the expiration date is, of course, a date picker.
In my theme, within the members-loop.php loop, I have the following code:
// This one works
<?php $ad = bp_get_member_profile_data('field=Member Directory Ad'); ?>
// This one doesn't
<?php $ad_expiry = bp_get_member_profile_data('field=Member Directory Ad Expiration'); ?>
There is no other special code to make this happen. I see no reason why the $ad_expiry is blank for a member who definitely has it set, especially when $ad has the correct value.
Digging into the buddypress code, my extended profile datebox data is not being returned by bp_get_member_profile_data(). Inside xprofile_format_profile_field() the value is being "formatted" by bp_format_time() and the output is empty. So I guess it's a buddypress bug.
I've figured out the bug, at least. BuddyPress stores the output of the datebox as a string like "2012-07-19 00:00:00". bp_get_member_profile_data() retrieves that from the database and then passes it to xprofile_format_profile_field(), which passes it to bp_format_time(), which returns false because the value fails the is_numeric() check.
Try this workaround -
//you need to specify the $user_id
$ad_expiry = xprofile_get_field_data('Member Directory Ad Expiration', $user_id );
// reformat, if you like
$ad_expiry = strtotime($ad_expiry);
echo date('m/d/Y', $ad_expiry);
.
And thanks for the bug report on trac.
The website that im trying to make it work on is http://www.phone7forum.com/
The way I get it to show up on the index page is adding this code to the core index.php page right below this:
// Assign index specific vars
'S_AVATAR' => get_user_avatar(
$user->data['user_avatar'],
$user->data['user_avatar_type'],
$user->data['user_avatar_width'],
$user->data['user_avatar_height']
),
Then I can use {S_AVATAR} in my template but it ONLY shows up in the index file... So another phpbb guy suggested that I take that same code from above and place it in the includes/functions.php file right below this:
// The following assigns all _common_ variables that may be used at any point in a template.
I did that, and though it seemed to "try" and work I clicked on a few pages outside the index page and got a fatal error message:
Fatal error: Call to undefined function get_user_avatar() in /home/content/04/6534704/html/phone7forum/includes/functions.php on line 4385
Does anyone have any ideas?
IIRC get_user_avatar() is a function from functions_display. If you want to use it in the functions file, you have to include it.
Put it into an if condition to have it only load if you're on a page where function_display isn't already included:
if(!function_exists('get_user_avatar')){ include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); }