• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Variable BLOG is undefined in mango blog

Community Beginner ,
Jan 27, 2015 Jan 27, 2015

Copy link to clipboard

Copied

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

Views

268

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 28, 2015 Jan 28, 2015

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation