2 of 2
2
EE2, Matrix, SAEF, and SafeCracker
Posted: 05 April 2011 01:54 AM   [ Ignore ]   [ # 16 ]
Wallflower
Rank
Total Posts:  6
Joined  2011-04-05

So, I’m looking for these names in my database?

Profile
 
 
Posted: 05 April 2011 01:55 AM   [ Ignore ]   [ # 17 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Yep, in exp_matrix_cols. Match up the col_id_X’s with your col names.

Profile
 
 
Posted: 05 April 2011 03:26 AM   [ Ignore ]   [ # 18 ]
Wallflower
Rank
Total Posts:  6
Joined  2011-04-05

Alright, that worked. I was able to find the column names by looking at the page source in the Custom Fields page for the matrix.

Next question: How can I post the current date into one of the Matrix cells?

<input type="hidden" name="project_entry[row_order][]" value="row_new_0">
<
input name="project_entry[row_new_0][col_id_42]" type="text" value="" placeholder="Post Title" /><br/>    
Posted By:<br/> 
<
input name="project_entry[row_new_0][col_id_38]" type="text" value="" placeholder="Post By" /> <br/>  
<
input name="project_entry[row_new_0][col_id_39]" type="hidden" value="{current_time format="{DATE_ATOM}"}" /><br/>       
Note:<br/>     
<
input name="project_entry[row_new_0][col_id_40]" type="text" style="width:100px; height:100px;" value="" placeholder="Note" /><br/>    
Upload FilePDFDocTxt<br/> 
<
input type="file" name="project_entry[row_new_0][col_id_41]" size="40"><br/>
Upload Image:<br/> 
<
input type="file" name="project_entry[row_new_0][col_id_42]" size="40"><br/>    

<
input type="submit" value="Submit" /> 

 

I tried this. Which I found at: http://expressionengine.com/user_guide/templates/date_variable_formatting.html

<input name="project_entry[row_new_0][col_id_39]" type="hidden" value="{current_time format="{DATE_ATOM}"}" /> 

I’m wondering if I need to make the matrix date cell, into a text cell. Or am I formatting the date incorrectly?

Thoughts?

Profile
 
 
Posted: 05 April 2011 04:31 AM   [ Ignore ]   [ # 19 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

If it’s a date cell you need to use this date format:

{current_time format="%Y-%m-%d %h:%i %A"
Profile
 
 
Posted: 05 April 2011 05:47 AM   [ Ignore ]   [ # 20 ]
Wallflower
Rank
Total Posts:  6
Joined  2011-04-05

Thank you. Worked like a charm.

Profile
 
 
Posted: 06 April 2011 01:22 AM   [ Ignore ]   [ # 21 ]
Wallflower
Rank
Total Posts:  6
Joined  2011-04-05

Ok, so I got it working as intended on Safari. But the form fails on Chrome and Firefox 3. Firefox 4 is fine. The firebug report is to the extent of “EE not defined”.  Showing a couple lines of php code that is deep in the system. And the form doesn’t show up at all.

Any ideas?

Profile
 
 
Posted: 07 April 2011 12:11 PM   [ Ignore ]   [ # 22 ]
Wallflower
Rank
Total Posts:  6
Joined  2011-04-05

I went through the code and found the following. It seems that a javascript call is failing. And only spitting out some partial javascript. I replaced the url with “websiteurl”.

What the html is saying, where the form should be:

// <![CDATA[ $(document).ready(function() {if (typeof SafeCracker == "undefined" || ! SafeCracker) { var SafeCracker = {markItUpFields:{}};}$.datepicker.setDefaults({dateFormat:$.datepicker.W3C+EE.date_obj_time}); }); // ]]>
[removed]<style type="text/css">.hasDatepicker{background:#fff url(http://websiteurl.com/themes/cp_themes/default/images/calendar_bg.gif) no-repeat 98% 2px;background-repeat:no-repeat;background-position:99%;}</style>[removed]$.createDatepickerTime=function(){a=new Date();b=a.getHours();c=a.getMinutes();if(c<10){c="0"+c;}if(b>12){b-=12;d=" PM";}else if(b==12){d=" PM";}else{d=" AM";}EE.date_obj_time=" '"+b+":"+c+d+"'";};$.createDatepickerTime();[removed]
</div


Firebug Error Report

EE is not defined

http://websiteurl.com/index.php?ACT=23&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=scrollable,scrollable.navigator,ee_filebrowser,markitup,thickbox&v=1299745480&include_jquery=y 

Line 564


EE is not defined
Line 56

<style type="text/css">.hasDatepicker{background:#fff url(http://websiteurl.com/themes/cp_themes/default/images/calendar_bg.gif) no-repeat 98% 2px;background-repeat:no-repeat;background-position:99%;}</style>[removed]$.createDatepickerTime=function(){a=new Date();b=a.getHours();c=a.getMinutes();if(c<10){c="0"+c;}if(b>12){b-=12;d=" PM";}else if(b==12){d=" PM";}else{d=" AM";}EE.date_obj_time=" '"+b+":"+c+d+"'";};$.createDatepickerTime();[removed] 


EE is not defined
Line 52

$.datepicker.setDefaults({dateFormat:$.datepicker.W3C+EE.date_obj_time}); 

Am I missing a global preference or something? It seems to be failing on a date object.

Profile
 
 
Posted: 07 April 2011 05:56 PM   [ Ignore ]   [ # 23 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

You should be seeing something like this in your markup:

[removed]// <![CDATA[ 
if (typeof EE == "undefined" || ! EE
var EE {"BASE":"/?","THEME_URL":"/themes/cp_themes/default/","PATH_CP_GBL_IMG":"/themes/cp_global_images/","filebrowser":{"endpoint_url":"ACT=8","window_title":"File Manager","theme_url":"/themes/cp_themes/default/"},"lang":{"or":"or","resize_image":"Resize Image","return_to_publish":"Return to Publish","confirm_exit":"When you leave, any data entered will be lost. Are you sure you want to leave?","add_new_html_button":"Add New HTML button"},"publish":{"show_write_mode":true,"title_focus":true,"smileys":false},"user_id":"1","XID":"560d16e04de4fa1728fa62e082f25d79dc2181f1"};}
mySettings 
{"nameSpace":"html","onShiftEnter":{"keepDefault":false,"replaceWith":"<br />\n"},"onCtrlEnter":{"keepDefault":false,"openWith":"\n<p>","closeWith":"</p>\n"},"markupSet":[{"name":"b","key":"B","openWith":"<strong>","closeWith":"</strong>","className":"btn_b"},{"name":"i","key":"I","openWith":"<em>","closeWith":"</em>","className":"btn_i"},{"name":"blockquote","key":"Q","openWith":"<blockquote>","closeWith":"</blockquote>","className":"btn_blockquote"},{"name":"a","key":"A","openWith":"<a >","closeWith":"</a>","className":"btn_a"},{"name":"img","key":"","replaceWith":"","className":"btn_img"}]};
myWritemodeSettings {"nameSpace":"html","onShiftEnter":{"keepDefault":false,"replaceWith":"<br />\n"},"onCtrlEnter":{"keepDefault":false,"openWith":"\n<p>","closeWith":"</p>\n"},"markupSet":[{"name":"b","key":"B","openWith":"<strong>","closeWith":"</strong>","className":"btn_b"},{"name":"i","key":"I","openWith":"<em>","closeWith":"</em>","className":"btn_i"},{"name":"blockquote","key":"Q","openWith":"<blockquote>","closeWith":"</blockquote>","className":"btn_blockquote"},{"name":"a","key":"A","openWith":"<a >","closeWith":"</a>","className":"btn_a"},{"name":"img","key":"","replaceWith":"","className":"btn_img"}],"onTab":{"keepDefault":false,"replaceWith":"\t"}};

 
// ]]>
[removed] 
Profile
 
 
Posted: 07 April 2011 05:57 PM   [ Ignore ]   [ # 24 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

You can also turn off the datepicker if you’re not using it:

datepicker="no" 
Profile
 
 
Posted: 07 April 2011 05:57 PM   [ Ignore ]   [ # 25 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

And you should not have your global debug preference set to 0.

Profile
 
 
   
2 of 2
2