2.0 is here!
2.0 is here - but I'll be writing about it up on my main blog: http://www.coldfusionjedi.com.
2.0 is here - but I'll be writing about it up on my main blog: http://www.coldfusionjedi.com.
2.007
Raymond Camden said: Are you using the latest release? Please use the bug tracker instead of the blog to report possible ...
[more]
2.007
Jason said: I keep getting this error everytime I try to post to the forum as a test user I set up. I can't figu...
[more]
2.0 is here!
Raymond Camden said: Can you point out an example of one of the bad urls?
[more]
2.0 is here!
Ken said: errr "& a m p ; ".... minus the spaces :D
[more]
2.0 is here!
Ken said: I just wanted to add, that WC3 testing will trigger a bunch of flags cause of not properly using &qu...
[more]
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4. Is anyone got something similar?
[settings]
Editing per request of poster. -Ray
Also, since I saw that you had released version 2.001 and I hadn't set up any informtaion in the forum, I deleted the tables and reinstalled everything using the files in the 2.001 zip. Then I had my hosting company confirm my DSN to the MS SQL db just to make sure that was ok. Then I did a simple SELECT * FROM galleon_users and dumped the results to verify that it was working with the DSN
Tim
If I go go the login.cfm page and register as a new user - it saves that info to the database and sends the confirmation e-mail. If I then log in as the admin and go to the User Editor page I will see that user listed. When I click on their username and go to their profile I see all of the information entered in the user profile. If I a make a change, let's say, change the password, and click save, the page processes still showing the new information (at that point it looks like it has updated the info). However, if I go back to the listing of users (users.cfm), and click on the user name and go to the User Editor page (users_edit.cfm), the old or original information is still there and has not been updated to the new info.
Example 2:
If I go to the forum admin and click on the Conferences option under forum options – I am now on the /forum/admin/conferences.cfm conferences page. I click Add Conferences which takes me to the Conference Editor page (forum/admin/conferences_edit.cfm?id=0). I enter all the info (name, desc, etc.,) and click on the save button. The page processes and again looks like everything saves (with the exception that if you highlight an option other that the default, you notice that after the page processes the default is highlighted again no matter what you chose). Then I click on the Conferences link under Forum options to see the forum listings and the conference is not there.
Example 3:
If I go to the Galleon Settings page, and change the Items Per Page to 10 instead of 17, click save, the page processes and Items per page will still say 10. If I then click on the Conferences tab and then click the Galleon Settings link to go back to the settings page, the items per page is back at 17 instead of 10. I realize this is updating this should update the ini file so I also tried the ?reinit=1 to see if that had anything to do with the new settings not showing up here and it didn’t affect the results.
Sorry for the hassle and thanks for the help.
Tim
I am doing this on c drive. I did settings correctly.
I did installation on my C drive Coldfusion developer edition with SQL server 2005 express edition. I did re-init=1 as well. The coldfusion gives error saying [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'group'. This error occurs in user.cfc
If I change the group column to groupname, even in database (group changed to groupname)the code starts working. But then I will have to globally replace group with groupname everywhere, that is tedious task.
Your code at that line is:
<cfquery name="qGetGroups" datasource="#variables.dsn#">
select id,
<cfif variables.dbtype is not "mysql">
[group]
<cfelse>
#variables.tableprefix#groups.group
</cfif>
from #variables.tableprefix#groups
</cfquery>
seems like it gets confused with [group] with the "group by" clause of sql .
I created a short program to see that, but running this query standalone gives results correctly, but it fails here.
My appologies. I did make a mistake in the setting.ini file. I had made changes to SQL server but then, I downloaded the source code again from your site and that overwrote the changes and I forgot about that.
Here is my new problem. I do not have a budget to host the site for $20/month, so I chose godaddy.com, they take $2/month for coldfusion. But they do not allow createObject or CFObject. I see a lot of createObject for instantiation. I have been converting them to CFINVOKE. But in objectfactory.cfc, I do not know how to convert the following to cfinvoke as there is no method defined for that. And also can you explain me this code. And why is there no init() in the galleon.cfc?
case "galleonSettings":
obj = createObject('component','galleon');
if (arguments.singleton) { // scope singleton addSingleton(arguments.objName, obj);
}
return obj;
break;
I did convert it for example:
case "conference":
obj = createObject('component','conference').init();
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
obj.setForum( get('forum', arguments.singleton) );
obj.setUtils( get('utils', arguments.singleton) );
return obj;
I did change that to
<cfinvoke component ="conference" method="init" returnvariable="obj">
</cfinvoke>
<cfscsript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
obj.setForum( get('forum', arguments.singleton) );
obj.setUtils( get('utils', arguments.singleton) );
return obj;
<cfscript>
I think the above code is a mix of tag based + cfscript syntax. But its valid syntax, and this works fine.
But I am just confused as to how to convert the below one to CFINVOKE as there is no method when you do createObject.
case "galleonSettings":
obj = createObject('component','galleon');
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
return obj;
And on Cfinvoke, I have to supply a method.
And as I asked earlier, why there is no init() in the Galleon.cfc? There must be a reason why you do not have that. I am learning by looking at your code & your blogs.
Value must be initialized before use.
Its possible that a method called on a Java object created by CreateObject returned null.
The error occurred in C:\ColdFusion8\wwwroot\Forums\Application.cfm: line 31
29 :
30 : <!--- Get main settings --->
31 : <cfset application.settings = application.factory.get('galleonSettings').getSettings()>
32 :
And basically it is coming because I converted in objectfactory.cfc all the createObject to cfinvoke, I did same in Application.cfm as well.
I am just getting a feeling that there is no workaround for createObject(). This application can not be coded using CFINVOKE tag.
<cfsetting enablecfoutputonly="true" showdebugoutput="false">
<!---
Name : Application.cfm
Author : Raymond Camden
Created : June 01, 2004
Last Updated : October 29, 2007
History : Reset for V2
: Fix for IE login issue (rkc 10/15/07)
: Remove BlueDragon mod (not needed in latest BD, thanks to Vince B for letting me know!) (rkc 10/29/07)
Purpose :
--->
<cfset appName = "galleonForums">
<cfset prefix = getCurrentTemplatePath()>
<cfset prefix = reReplace(prefix, "[^a-zA-Z]","","all")>
<cfset prefix = right(prefix, 64 - len(appName))>
<cfapplication name="#prefix##appName#" sessionManagement=true loginstorage="session">
<cferror type="exception" template="error.cfm">
<cfif not isDefined("application.init") or isDefined("url.reinit")>
<cfset structDelete(application, "userCache")>
<!--- get user CFC --->
<cfinvoke component="cfcs.objectfactorynew" method="init" returnvariable="application.factory">
</cfinvoke>
<!--- Get main settings --->
<cfinvoke method="getSettings" returnvariable="application.settings" component="cfcs.galleon">
</cfinvoke>
<cfset application.settings.attachmentdir = getDirectoryFromPath(getCurrentTemplatePath()) & "attachments">
<cfset application.settings.avatardir = getDirectoryFromPath(getCurrentTemplatePath()) & "images/avatars">
<cfif not directoryExists(application.settings.attachmentdir)>
<cfdirectory action="create" directory="#application.settings.attachmentdir#">
</cfif>
<cfif not directoryExists(application.settings.avatardir)>
<cfdirectory action="create" directory="#application.settings.avatardir#">
</cfif>
<!--- get user CFC --->
<cfinvoke component="cfcs.objectfactory" method="get" returnvariable="application.user" >
<cfinvokeargument name="objName" value="user">
</cfinvoke>
<!--- get utils CFC --->
<cfinvoke method="get" returnvariable="application.utils" component="cfcs.objectfactorynew">
<cfinvokeargument name="objName" value="utils">
</cfinvoke>
<cfdump var="#application.user#">
<cfabort>
<!--- get conference CFC --->
<cfinvoke method="get" returnvariable="application.conference" component="cfcs.objectfactorynew">
<cfinvokeargument name="objName" value="conference">
</cfinvoke>
<!--- get forum CFC --->
<cfinvoke method="get" returnvariable="application.forum" component="cfcs.objectfactorynew">
<cfinvokeargument name="obj" value="forum">
</cfinvoke>
<!--- get thread CFC --->
<cfinvoke method="get" returnvariable="application.thread" component="cfcs.objectfactorynew">
<cfinvokeargument name="obj" value="thread">
</cfinvoke>
<!--- get message CFC --->
<cfinvoke method="get" returnvariable="application.message" component="cfcs.objectfactorynew">
</cfinvoke>
<!--- get rank CFC --->
<cfinvoke method="get" returnvariable="application.rank" component="cfcs.objectfactorynew">
<cfinvokeargument name="obj" value="rank">
</cfinvoke>
<!--- get security CFC --->
<cfinvoke method="get" returnvariable="application.permission" component="cfcs.objectfactorynew">
<cfinvokeargument name="obj" value="permission">
</cfinvoke>
<!--- hard coded rights for now --->
<cfset application.rights.CANVIEW = "7EA5070B-9774-E11E-96E727122408C03C">
<cfset application.rights.CANPOST = "7EA5070C-E788-7378-8930FA15EF58BBD2">
<cfset application.rights.CANEDIT = "7EA5070D-CB58-72BA-2E4A3DFC0AE35F35">
<!---
<!--- get image CFC if we need it --->
<cfif application.settings.allowavatars>
<cfset application.image = application.factory.get('image')>
<cfset application.image.setOption("throwonerror", false)>
</cfif>
--->
<cfset application.init = true>
</cfif>
<!--- include UDFs --->
<cfinclude template="includes/udf.cfm">
<cfif isDefined("url.logout")>
<cfset structDelete(session, "user")>
<cflogout>
</cfif>
<!--- handle security --->
<cflogin>
<!--- are we trying to logon? --->
<cfif isDefined("form.logon") or isDefined("form.logon.x")>
<cfif isDefined("form.username") and isDefined("form.password")>
<cfif application.user.authenticate(trim(form.username), trim(form.password))>
<!--- good logon, grab their groups --->
<cfset mygroups = application.user.getGroupsForUser(trim(form.username))>
<cfset session.user = application.user.getUser(trim(form.username))>
<cfloginuser name="#trim(form.username)#" password="#trim(form.password)#" roles="#mygroups#">
</cfif>
</cfif>
</cfif>
</cflogin>
<!--- Used by index, forums, and threads ---->
<!--- however, if threads, default to lastpost --->
<!--- however, don't do this in the admin ;) --->
<cfif not structKeyExists(variables, "isAdmin")>
<cfif findNoCase("threads.cfm", cgi.script_name)>
<cfparam name="url.sort" default="lastpostcreated">
<cfparam name="url.sortdir" default="desc">
<cfelse>
<cfparam name="url.sort" default="name">
<cfparam name="url.sortdir" default="asc">
</cfif>
</cfif>
<cfsetting enablecfoutputonly=false>
This is ObjectFactory.cfc -- get Method
<cffunction name="get" access="public" output="No" returntype="any">
<cfargument name="objName" required="false" type="string" />
<cfargument name="singleton" required="false" type="boolean" default="true" />
<cfset obj = "">
<cftry>
<cfscript>
if (arguments.singleton and singletonExists(arguments.objName)) {
return getSingleton(arguments.objName);
}
</cfscript>
<cfswitch expression="arguments.objName">
<cfcase value="conference">
<cfinvoke component ="conference" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
obj.setForum( get('forum', arguments.singleton) );
obj.setUtils( get('utils', arguments.singleton) );
return obj;
</cfscript>
</cfcase>
<cfcase value="forum">
<cfinvoke component ="forum" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
obj.setThread( get('thread', arguments.singleton) );
obj.setConference( get('conference', arguments.singleton) );
obj.setUtils( get('utils', arguments.singleton) );
return obj;
</cfscript>
</cfcase>
<cfcase value="galleonSettings">
<!---
<cfinvoke component ="galleon" method="init" returnvariable="obj">
</cfinvoke>
--->
<cfscript>
obj=createObject("component","galleon");
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
return obj;
</cfscript>
</cfcase>
<cfcase value="message">
<cfinvoke component ="message" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
obj.setThread( get('thread', arguments.singleton) );
obj.setForum( get('forum', arguments.singleton) );
obj.setConference( get('conference', arguments.singleton) );
obj.setUser( get('user', arguments.singleton) );
obj.setUtils( get('utils', arguments.singleton) );
return obj;
</cfscript>
</cfcase>
<cfcase value="permission">
<cfinvoke component ="permission" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
return obj;
</cfscript>
</cfcase>
<cfcase value="rank">
<cfinvoke component ="rank" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
obj.setUtils( get('utils', arguments.singleton) );
return obj;
</cfscript>
</cfcase>
<cfcase value="thread">
<cfinvoke component ="thread" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
obj.setUtils( get('utils', arguments.singleton) );
obj.setForum( get('forum', arguments.singleton) );
obj.setMessage( get('message', arguments.singleton) );
return obj;
</cfscript>
</cfcase>
<cfcase value="user">
<cfinvoke component ="user" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
obj.setSettings( get('galleonSettings', arguments.singleton) );
obj.setUtils( get('utils', arguments.singleton) );
return obj;
</cfscript>
</cfcase>
<cfcase value="utils">
<cfinvoke component ="utils" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
return obj;
</cfscript>
</cfcase>
<cfcase value="image">
<cfinvoke component ="image" method="init" returnvariable="obj">
</cfinvoke>
<cfscript>
if (arguments.singleton) { // scope singleton
addSingleton(arguments.objName, obj);
}
// inject dependencies through setter
return obj;
</cfscript>
</cfcase>
<cfdefaultcase>
</cfdefaultcase>
</cfswitch>
<cfcatch>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
</cffunction>
Just thought you might want to run through your code and make sure it's up to WC3 standards.