Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Sørensen 33 posts 31 karma points
    Jan 14, 2010 @ 07:45
    Martin Sørensen
    0

    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

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 14, 2010 @ 08:55
    Thomas Höhler
    0

    The problem is that

    SELECT TOP 1 

    isn't standard SQL it is a keyword for MS SQL Server. MySql has to use

    SELECT... Limit 1

    I will report it to blogpackage core and will do a patch for it. Stay tuned...

    Thomas

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 14, 2010 @ 08:55
    Thomas Höhler
    0

    Seems taht you are the first one using the package on mysql *g*

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 14, 2010 @ 09:18
    Thomas Höhler
    0

    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...

    hth, Thomas

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 14, 2010 @ 09:22
    Tim Geyssens
    0

    @Thomas, what's your codeplex username ? will just add you as a developer that way you can commit your path.

     

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 14, 2010 @ 09:27
    Thomas Höhler
    0

    My Codeplex name is hoehler

    Thanks Tim

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 14, 2010 @ 09:34
    Tim Geyssens
    0

    Done, thanks for the solution Thomas!

  • Martin Sørensen 33 posts 31 karma points
    Jan 14, 2010 @ 12:26
    Martin Sørensen
    0

    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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 14, 2010 @ 13:02
    Tim Geyssens
    0

    @Martin, just compile the project and place the updated assembly (Umlaut.Umb.Blog) in the bin directory.

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 14, 2010 @ 13:03
    Tim Geyssens
    0

    Or as a temp solution you could also just remove the usercontrol from the dashboard by editing /config/dashboard.config

  • Martin Sørensen 33 posts 31 karma points
    Jan 15, 2010 @ 07:37
    Martin Sørensen
    0

    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.

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 15, 2010 @ 09:32
    Thomas Höhler
    0

    Take a look at the nightly builds. the changes from yesterday shuold have been included: http://nightly.umbraco.org/Blog4Umbraco/2.0.24/

    Thomas

  • 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.

Please Sign in or register to post replies