Now running BlogCFC without get-/setProfileString

Almost one week ago my blog went down. Replaced by an error telling me that "The requested template has been denied access to setprofilestring".

I posted a ticket with HostingAtoZ, where I have my sites hosted. The reply was that setProfileString is a restricted function and that I must have changed my code. I wrote them back telling that I've been running BlogCFC for a long time, and that they enabled setProfileString for my just for this purpose when I first installed BlogCFC. The answer was that they were wrong enabling it the first time and could not help.

Ok - I accept that it is a restricted tag, and I would have accepted getting a warning saying something like "we've discovered that by error...yadada.....could you make the necessary changes within a week." But that they suddenly just restrict it causing my blog to just go down like that - that is harder to accept.

For some days I've been considering moving over to another host, but dreaded the thought.

So instead I decided to see if I could get BlogCFC to work without using setProfileString and getProfileString. It took some trial and error, since I cant access robust error messages either, but here is what I came up with:

In the blog.cfc file in the org/camden/blog folder I just comented out the part with setProfileString so that line 2020 and 2021 was replaced with this:

<!---
<cfset setProfileString(variables.cfgFile, instance.name, arguments.property, arguments.value)>
<cfset instance[arguments.property] = arguments.value>
--->

The slightly (but not much) trickier part is in the utils.cfc file in the same folder. But what I did was to move the configuration info from the blog.ini.cfm file into the utils.cfc file. Now this is not good programing. I could have made a xml file or some other configuration file, and I might still do, but this was a shoot at getting the blog up and running as fast as possible.

Here's part of the code (starting on line 119 in the configParam() method:

<!--- delete parts with get- and setProfileString --->
<cfset var result = "">
      
<cfswitch expression="#key#">
<cfcase value="dsn">
   <cfset result="my_dsn">
</cfcase>
<cfcase value="owneremail">
   <cfset result="trond@ulseth.no">
</cfcase>
<cfcase value="blogURL">
   <cfset result="http://trond.ulseth.no/index.cfm">
</cfcase>
<!--- continue for each or the config params in the blog.ini.cfm file --->
</cfswitch>

<cfreturn result>

As I said - not the best solution, but it's working (apparently).

Comments
I still think you're better off moving elsewhere. I've been having similiar issues with hostingatoz as well. I'm planning to move to another hosting service, preferably one that will soon support CF8 when it goes final and am researching to see what else is available out there. Seems that what you pay for is what you get.
# Posted By Lola LB | 6/5/07 7:49 AM
why fight it. just go with hostmysite.com.
# Posted By tony petruzzi | 6/5/07 7:52 AM
yeah, when i first tried setting up blogCFC on hostingAtoZ, i moved the .ini file to .xml and everything worked a treat.

i still say for the $, they're a great hosting option. maybe not for a commercial site... but just to have a playground or a place to host your personal site (with CFMX 7 Enterprise and minimal restrictions on tag usage), you can't go wrong.
# Posted By charlie griefer | 6/5/07 12:01 PM
Right on Charlie. I have a small bunch of personal sites of different sorts, none of them commercial in any way, and should I get HostMySite level hosting I'd have to pay a lot more than I'd like. I know - I did at one time have a dedicated server with HostMySite, and while I understan I was far worse of luck than most, I have to say that even with them there can be a lot of problems. Enough about that!

For the buck (about $15) I can host up to 50 sites with HostingAtoZ, and with the Helm controll panel and stuff, for that price I'll even accept not being able to use get/setprofilestring (personaly I've never used those functions in my own coding). I was a pretty anoyed when my blog went down though. They could have handeled that a bit smoother.

So enough about that as well. The next posts will be on newBee, FarCry or other more interesting topics.
# Posted By Trond Ulseth | 6/5/07 6:07 PM
Hmmm, I hope they don't change that on the site I have hosted with them :P I can't afford any other CF hosting, hah...
# Posted By Justin Carter | 6/5/07 6:30 PM
Trond, I have a similar problem - some of my hosting clients want to run blog.cfc but we dont want to enable setprofilestring() either. Would it be ok with you if i put your info (modified to read as a how-to-set-up-blog.cfc-at-afpwebworks) on my support area? Of course with full attribution to yo uas the originator of the technique?
# Posted By Mike Kear | 6/5/07 11:29 PM
Go ahead Mike - I don't mind at all. Even though, as I said, this is a quick and dirty way of getting past the problem, not very a very elegant one. On the other side - it is working - and that is what matter for me right now. At another time, when I have little else to do, I might go with the xml route (I actually think Ray should do the same with the core code - but that's another discussion), or I might just be lazy and try to bug Charlie to give away his code :)
# Posted By Trond Ulseth | 6/6/07 2:21 AM
As another shared-hostee I wish I knew which hosters were upgrading to CF8. ColdFusion-wise Daily Razor has been great (VIUX and CrystalTech not so much...), I just wish I knew if they'd be upgrading...

PS. Sorry for the late comment, just found your blog =)
# Posted By Joe Zack | 6/24/07 7:33 PM
Joe, I run a shared hosting business, and I'm not going to consider upgrading to CF8 AT ALL until ALL of the following conditions are met:

[A] the product is released - it might be the same as the public beta or it might not. Thats why you have a beta - to fully test every aspect under real world conditions - some features of the beta product might not be in the final release.
[B] a reasonable time has elapsed to tell if there are any 'gotchas' for shared hosters. We know what Adobe SAY is the recommended hardware to go with it, but what works out in practice? Are we going to have to upgrade our hardware as well to keep performance high enough?
[C] pricing is announced. At this stage we dont know if it's going to make business sense or not because we can't do any of the arithmetic yet.
[D] we can make an assessment about the customer demand. Will our customers be clamouring for it or not? How many people are clamouring for WIndows Vista? Not that many apparently. Will CF8 be like that or not? Dont forget we have a pretty substantial investment in CF7 Enterprise already. If we're going to invest in CF8 enterprise, we want to know that there was a good business case for it.

We'll do the business case when the product's released. I would almost guarantee that all the CF hosting companies are evaluating CF8 now, but few will make any announcements until the product is released.
# Posted By Mike Kear | 6/24/07 8:33 PM
@Mike

Those are some really excellent points you make, I just wish I could fast-forward a bit =)

In particular I'm looking forward to finding a hosting plan w/ CF8 because it allows ColdFusion mappings and custom tag paths to be set per Application, which will save me from having to send a ticket every time I need a change for any of my shared hosting sites. =)
# Posted By Joe Zack | 6/24/07 8:44 PM
The use of the ini file will be removed in BlogCFC6, mainly due to internationalization issues with CF's set/getProfileString. I'll be switching to an XML format. This isn't as easy to edit - but I'm hoping to have a proper installer for BlogCFC6 as well.
# Posted By Raymond Camden | 8/16/07 12:25 PM
That's good news Ray. And who knows, maybe I'll be a bit faster upgrading what version of BlogCFC I run this time. I was running version 3 something before upgrading to the current one - which is 5.1.004.
# Posted By Trond Ulseth | 8/16/07 5:31 PM
o.K., some I'm with a Host i thought was good, DailyRazor, until all of a sudden they hosed my site (blogcfc the only thing running). I spent countless hours recoding it to get it to work in a shared host enviro, and now Daily Razor has disbaled the setprofilestring function, and they gave me th link to this page. I changesd the code and now I'm getting all kinds of otehr CF errors.

The first being The method 'init' could not be found in component C:\Inetpub\vhosts\normsblog.net\httpdocs\org\camden\blog\ping.cfc.
Check to ensure that the method is defined, and that it is spelled correctly.

The error occurred in C:\Inetpub\vhosts\normsblog.net\httpdocs\org\camden\blog\blog.cfc: line 104

102 :    <!---    <cfset variables.ping = createObject("component", "ping")> --->
103 :       <!--- <cfset variables.ping = cfinvoke("component","ping")> --->
104 :    <cfinvoke component="ping" method="init" returnvariable="variables.ping"> </cfinvoke>


Any help would be appreciated.....

Man, I think I'll write my own CF BLOG... It weould be less coding... LOL
# Posted By Norm Bouffard | 10/25/07 1:09 PM
Hey Norm. The ping method did not have an init function, so the work around you used elsehwere would not work there. You could modify ping.cfc to have an init method that just did a cfreturn this. Don't switch blogs - switch hosts. :)
# Posted By Raymond Camden | 10/25/07 1:24 PM
O.K., My bad. I was doing too much "work" coding a the same time I was trying to fic my site and I missed the in the cfswitch tag. Props to the supprt guys at Daily Razor for picking it up.

I retract my diss of Daily Razor. and I'll keep the BLOGCFC :)
# Posted By Norm Bouffard | 10/25/07 8:09 PM