Could not load control '/usercontrols/Blog4Umbraco/CreatePost.ascx'.
Hi,
After installing the package I keep being asked for username and password as if I'm trying to see files in a folder which requires login. Also when I wan't to see the blog. I'm running Umbraco v 4.0.2.1
When I logon the Umbraco system I get the following message.
Could not load control '/usercontrols/Blog4Umbraco/CreatePost.ascx'. Error message: umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteScalar ---> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 ID, PATH FROM UMBRACONODE INNER JOIN CMSCONTENT ON CMSCONTENT.NODEID = UMBRACO' at line 1 at MySql.Data.MySqlClient.MySqlStream.OpenPacket() at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId) at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar() at MySql.Data.MySqlClient.MySqlHelper.ExecuteScalar(MySqlConnection connection, String commandText, MySqlParameter[] commandParameters) at MySql.Data.MySqlClient.MySqlHelper.ExecuteScalar(String connectionString, String commandText, MySqlParameter[] commandParameters) at umbraco.DataLayer.SqlHelpers.MySql.MySqlHelper.ExecuteScalar(String commandText, MySqlParameter[] parameters) at umbraco.DataLayer.SqlHelper`1.ExecuteScalar[T](String commandText, IParameter[] parameters) --- End of inner exception stack trace --- at umbraco.DataLayer.SqlHelper`1.ExecuteScalar[T](String commandText, IParameter[] parameters) at Umlaut.Umb.Blog.Dashboard.CreatePost.SetBlogRoot() in d:\TeamCity\buildAgent\work\6c8a1edaa924eb51\Umlaut.Umb.Blog\Dashboard\CreatePost.ascx.cs:line 119 at Umlaut.Umb.Blog.Dashboard.CreatePost.OnInit(EventArgs e) in d:\TeamCity\buildAgent\work\6c8a1edaa924eb51\Umlaut.Umb.Blog\Dashboard\CreatePost.ascx.cs:line 41 at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at umbraco.cms.presentation.dashboard.OnInit(EventArgs e)
Ok, fast solution: Download the code from codeplex (http://codeplex.com/blog4umbraco) and change in the codebehind of the dashboard/CreatePost.ascx the following method:
private void SetBlogRoot() { if (_parentId == -1) { string sql = "select id, path from umbracoNode " + "inner join cmsContent on cmsContent.nodeId = umbracoNode.id " + "inner join cmsContentType on cmsContentType.nodeId = cmsContent.contentType " + "where cmsContentType.alias = '{0}' and path not like '%-20%' and path like '%{1}%' " + "order by path"; string userStartNode = (umbraco.BasePages.UmbracoEnsuredPage.CurrentUser.StartNodeId != -1) ? "," + umbraco.BasePages.UmbracoEnsuredPage.CurrentUser.StartNodeId + "," : umbraco.BasePages.UmbracoEnsuredPage.CurrentUser.StartNodeId + ","; sql = String.Format(sql, GetBlogDocumentType().Alias, userStartNode); IRecordsReader reader = umbraco.BusinessLogic.Application.SqlHelper.ExecuteReader(sql); reader.Read(); _parentId = reader.GetInt("id"); } }
As I said I will submit this to codeplex as a patch...
Could not load control '/usercontrols/Blog4Umbraco/CreatePost.ascx'.
Hi,
After installing the package I keep being asked for username and password as if I'm trying to see files in a folder which requires login.
Also when I wan't to see the blog.
I'm running Umbraco v 4.0.2.1
When I logon the Umbraco system I get the following message.
Could not load control '/usercontrols/Blog4Umbraco/CreatePost.ascx'.
Error message: umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteScalar ---> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 ID, PATH FROM UMBRACONODE INNER JOIN CMSCONTENT ON CMSCONTENT.NODEID = UMBRACO' at line 1 at MySql.Data.MySqlClient.MySqlStream.OpenPacket() at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId) at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar() at MySql.Data.MySqlClient.MySqlHelper.ExecuteScalar(MySqlConnection connection, String commandText, MySqlParameter[] commandParameters) at MySql.Data.MySqlClient.MySqlHelper.ExecuteScalar(String connectionString, String commandText, MySqlParameter[] commandParameters) at umbraco.DataLayer.SqlHelpers.MySql.MySqlHelper.ExecuteScalar(String commandText, MySqlParameter[] parameters) at umbraco.DataLayer.SqlHelper`1.ExecuteScalar[T](String commandText, IParameter[] parameters) --- End of inner exception stack trace --- at umbraco.DataLayer.SqlHelper`1.ExecuteScalar[T](String commandText, IParameter[] parameters) at Umlaut.Umb.Blog.Dashboard.CreatePost.SetBlogRoot() in d:\TeamCity\buildAgent\work\6c8a1edaa924eb51\Umlaut.Umb.Blog\Dashboard\CreatePost.ascx.cs:line 119 at Umlaut.Umb.Blog.Dashboard.CreatePost.OnInit(EventArgs e) in d:\TeamCity\buildAgent\work\6c8a1edaa924eb51\Umlaut.Umb.Blog\Dashboard\CreatePost.ascx.cs:line 41 at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at umbraco.cms.presentation.dashboard.OnInit(EventArgs e)
Any ideas?
Is it read/write access to the folder?
/Martin
The problem is that
isn't standard SQL it is a keyword for MS SQL Server. MySql has to use
I will report it to blogpackage core and will do a patch for it. Stay tuned...
Thomas
Seems taht you are the first one using the package on mysql *g*
Ok, fast solution: Download the code from codeplex (http://codeplex.com/blog4umbraco) and change in the codebehind of the dashboard/CreatePost.ascx the following method:
As I said I will submit this to codeplex as a patch...
hth, Thomas
@Thomas, what's your codeplex username ? will just add you as a developer that way you can commit your path.
My Codeplex name is hoehler
Thanks Tim
Done, thanks for the solution Thomas!
Thank you so far.
I need some help on how to get the change implemented in Umbraco.
Do I need to compile the file after the changes or where are the ascx.cs file placed?
/Martin
@Martin, just compile the project and place the updated assembly (Umlaut.Umb.Blog) in the bin directory.
Or as a temp solution you could also just remove the usercontrol from the dashboard by editing /config/dashboard.config
I search through all my cd's with programs and I can't find my Visual Studio 2005 (I got it while I was studying, through download from Microsoft).
Could anyone build this dll file for me?
I haven't been able to find another program which could have done the job.
Take a look at the nightly builds. the changes from yesterday shuold have been included: http://nightly.umbraco.org/Blog4Umbraco/2.0.24/
Thomas
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.