Skip to main content
Participating Frequently
January 27, 2015
Question

Variable BLOG is undefined in mango blog

  • January 27, 2015
  • 1 reply
  • 331 views

Variable BLOG is undefined

I created mango blog a year ago and it was working fine but now it is showing me error in admin panel login like this Variable BLOG is undefined

Variable BLOG is undefined.

at cflogin2ecfm1129036560.runPage(C:\sites\accounts\ddddd.com\www\blog\admin\login.cfm:7)

Login page code : 

<cfif structkeyexists(templates,"login")>

  <cfset request.adminLoginTemplate = blog.getSetting('skins').path & blog.getSkin() & "/" & templates['login'].file />

</cfif>

application cfc code

<cfsetting showdebugoutput="false">

<cfset blog = request.blogManager.getBlog() />

<cfset isAdmin = findNoCase(blog.getSetting('urls').admin,arguments.targetPage)/>

<cfif isAdmin AND NOT ( request.blogManager.isCurrentUserLoggedIn() AND

listFind(request.blogManager.getCurrentUser().getCurrentrole(blog.getId()).permissions, "access_admin") )>

<cfset request.administrator = request.blogManager.getAdministrator() />

<cfinclude template="admin/login.cfm">

<cfreturn false>

<cfelseif isAdmin>

<!--- until we get error handling in the admin, remove onError method --->

<cfset StructDelete(this,"onError") />

<cfset request.administrator = request.blogManager.getAdministrator() />

<cfset request.formHandler = createObject("component","admin.FormHandler").init(request.administrator,

request.blogManager.getCurrentUser()) />

</cfif>

<cfset structappend(request,request.blogManager.handleRequest(targetPage,url,form),true)/>

<cfreturn true>

Pls help me

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
January 28, 2015

I expected the lines of code that are in REQUEST scope to be in onRequestStart rather than in the pseudo-constructor area (What's in a name, heh?). In any case, if you want the blog defined in the Application page to exist in login.cfm, it will have to be defined as <cfset request.blog = request.blogManager.getBlog() /> instead of <cfset blog = request.blogManager.getBlog() />. Accordingly, the code in login.cfm would also use request.blog in place of blog.