tracker issue : CF-3194042

select a category, or use search below
(searches all categories and all time range)
Title:

inconsistent_use_of underscores_in cfschedule's result_fields_and attribute_values

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 05/18/2012

Components: Scheduler

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final / 283018,285188

Priority/Frequency: Minor / Some users will encounter

Locale/System: English / Win All

Vote Count: 1

Listed in the version 2016.0.03.300466 Issues Fixed doc
First_Issue:
-----------
<cfschedule inconsistently uses underscores for new attribute values. Example:

Look at this line of code: <cfschedule onmisfire="fire_now" onexception="invokehandler"

See? Both values are 2-words and both were added in CF10, but only one of them uses an underscore.

Thus, "fire_now" should be "firenow".
-----------


Second_Issue:
-----------
<cfschedule inconsistently uses underscores for result field names. Repro:

a) Run this: <cfschedule action="list" result="q" /><cfdump var="#q#" />
b) See these fields: CHAINED_TASK, LAST_FIRE, PROXY_PORT, PROXY_SERVER, REMAINING_COUNT, RESOLVE_URL, RETRY_COUNT
c) Also see these fields: CRONTIME, ENDDATE, ENDTIME, EVENTHANDLER, STARTDATE, STARTTIME

So now developers have to remember which ones use underscores and which ones don't. That causes confusion and should be cleaned up in the next release. For consistency w/ the rest of the language (i.e. cfquery's result struct, cfhttp's result struct, etc) the underscores in cfschedule's result struct should be removed.

It was stated that underscores make the terms more readable. Well..

What about cfchedule's actions: action="pauseall", action="resumeall", onexception="invokehandler", and onmisfire="invokehandler?

Should those be: cron_time, end_date, end_time, event_handler, start_date, start_time, pause_all, resume_all, invoke_handler?

What about cfhttp’s result variables: charset, errordetail, filecontent, mimetype, responseheader, statuscode?

Should those be: char_set, error_detail, file_content, mime_type, response_header, status_code?

What about getTimeZoneInfo()’s result variables: utcTotalOffset, utcHourOffset, utcMinuteOffset, isDSTOn?

Should those be: utc_total_offset, utc_hour_offset, utc_minute_offset, is_dst_on?

What about cfdirectory’s datelastmodified result value?  Should that be date_last_modified?

What about getFileInfo()’s result variables: lastmodified, canread, canwrite, ishidden?

Should those be: last_modified, can_read, can_write, is_hidden?

What about cfquery’s result variables: recordcount, sqlparameters, columnlist, executiontime, generatedkey?

Should those be: record_count, sql_parameters, column_list, execution_time, generated_key?

(The above tags/functions are just some of the examples.  I understand CGI variables use underscores, and that cfqueryparam’s cfsqltype attribute takes values having underscores, and that the old db-specific cfquery result variables for the ID of the inserted row used underscores, but MOST of the examples in CF do not use underscores to join words)

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3194042

Keywords:
FixTested


External Customer Info:
External Company:  
External Customer Name: itisdesign
External Customer Email:

Attachments:

Comments:

Related thread: http://prerelease.adobe.com/r/?488798ff1e5a4182a4658768288a1642
Comment by External U.
19409 | May 18, 2012 10:20:44 PM GMT
+1. CF should stick to its own variable-naming precedent here. This is making the language seem sloppily planned. -- Adam
Vote by External U.
19418 | May 28, 2012 01:06:58 AM GMT
This ticket is for two issues: 1) removing underscores from attribute values (i.e. onmisfire="fire_now" should become onmisfire="firenow") and 2) removing underscores from action="list" result variables (i.e. queryResult.last_fire should become queryResult.lastFire) I see this ticket is marked fixed. Are both issues fixed? If not, which one? Thanks!, -Aaron
Comment by External U.
19410 | November 20, 2012 03:34:57 PM GMT
onmisfire="FIRE_NOW" works fine onmisfire="FIRENOW" or onmisfire="firenow" doesn't trigger the task on server start. Tested in CF10 version 285099 update 11 (Comment added from ex-user id:nawani)
Comment by Adobe D.
19411 | June 07, 2013 12:03:32 AM GMT
Adobe, This ticket is not fixed. You only fixed #1 (adding onmisfire="firenow"). You did not fix #2 (adding these result variables: CHAINEDTASK, LASTFIRE, PROXYPORT, PROXYSERVER, PROXYUSER, REMAININGCOUNT, RESOLVEURL, RETRYCOUNT) Repro: <cfscript> cfschedule(action="update", task="my task", url="http://a.com", interval="once", startdate=createDate(2015, 9, 29), starttime="00:00 AM"); cfschedule(action="list", task="my task", result="r"); for(key in "chainedtask,lastfire,proxyport,proxyserver,proxyuser,remainingcount,resolveurl,retrycount") { writeOutput(structKeyExists(r, key)); } //Actual result: NONONONONONONONO //Expected result: YESYESYESYESYESYESYESYES </cfscript> Please re-open. Thanks!, -Aaron
Comment by External U.
19412 | September 29, 2015 12:23:11 AM GMT
Aaron, Issue#2 is a low impact issue that needs to be viewed in light of the compatibility issues it might cause when porting an older application. Hence, we decided against taking it up.
Comment by Piyush K.
19413 | September 29, 2015 10:42:06 AM GMT
Hi Piyush, To maintain backward-compat, could #2 please be fixed the same as how #1 was fixed? Ex: result.chained_task would still work. And result.chainedtask would also now work. And possibly cfdump/writedump(result) could return, for example, result.chainedtask and hide result.chained_task (even tho result.chained_task would still work for backward-compat). Then, in the docs, the ones w/ underscores could be replaced w/ the ones w/o underscores. And the plan would be to eventually deprecate the ones w/ underscores (in like CF v20 or whenever). Thanks!, -Aaron
Comment by External U.
19414 | September 29, 2015 02:28:53 PM GMT
Hi Piyush, FYI, I *did* report this during the CF10 beta. It could've been fixed *during* the CF10 beta. But it was not fixed during the CF10 beta, and thus I created this ticket in the public tracker immediately after CF10 was released. Basically, I did everything that I could. Please consider that when reviewing my previous comment below. The idea I am proposing would only *hide* the ones w/ underscores (hide from cfdump/writedump() and hide from the docs), but they would still work until some future version when they can be deprecated. Thanks!, -Aaron
Comment by External U.
19415 | September 29, 2015 02:38:34 PM GMT
Adobe: "We won't fix that bug so we can maintain backward-compatibility." To me that translates to "Well, we've always done it wrong so why do it fix it now?" Only at Adobe is being Consistently Wrong viewed as a good thing.
Comment by External U.
19416 | September 30, 2015 06:16:30 PM GMT
This should be fixed to allow both variants work. So, chained_task and chainedtask can exist and the underscore version deprecated later.
Comment by Vamseekrishna N.
19417 | July 20, 2016 11:54:37 PM GMT