Unable to add page content

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
8/14/2007 4:38:56 AM
Gravatar
Total Posts 22

Unable to add page content

Hi Joe,

I am playing with Mojoportal 2.2.3.4 for MySQL, but I can't add content to the pages.

I thing the problem is the same as described by chris_at (http://www.mojoportal.com/ForumThreadView.aspx?thread=999&pageid=5&ItemID=2), but I do not get any exception logged.

I'm using the pencil way to add content, and no matter which feature I choose, the page roundtrip happens, but the listboxes for the panes are not updated.

Federico

8/14/2007 4:47:13 AM
Gravatar
Total Posts 22

Re: Unable to add page content

as a side note, I have to add that all the html content I tried to add are actually listed when I use Content Management to visualize them, and I can also edit them, but they are not displayed in the pages at the end.

Also the pre-existent Welcome content has never been displayed in the Home page.

8/14/2007 7:02:23 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Federico,

Have you made any changes to the globalization settings in Web.config or not?

Can you tell me what charset your db was created with?

I really appreciate your help in testing the different data layers!

Thanks,

Joe

8/14/2007 7:04:12 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

I am looking into this, just trying to figure out what I need to do to produce the problem as it worked for me in my previous testing.

Thanks,

Joe

8/14/2007 7:59:21 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Federico,

I found the bug about updating the page title and fixed it and uploaded a new version of the mysql data layer named 2-2-3-4-b. Just replace mojoPortal.Data.dll with the new one.

I still have not been able to reproduce the issue about adding content to the page. I will experiment with setting my browser language to Italian and see if that produces the problem. Any other suggestions for steps try and produce this would help.

Thanks,

Joe

8/14/2007 8:13:20 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Federico,

I am still unable to produce the problem about not adding page content and home page not being populated during setup. I changed my browser preferred language to Italian and it still works fine.

Any other details about your environment? I tried with Firefox, maybe I should try IE? What browser are you using? Did you change the globalization in Web.config?

Thanks,

Joe

8/14/2007 12:32:19 PM
Gravatar
Total Posts 22

Re: Unable to add page content

wow, so many replies; I really appreciate your effort on trying to solve the issues I got!

today I have very little spare time but tomorrow I will test the new dll and report to you.

to answer your questions: at the moment I used IE7 (I will test also with moz); I just checked the MySQL db table, and they are created with "DEFAULT CHARSET=latin1;"; i still have not changed the localization settings in the web.config.

by for now.
Federico

8/15/2007 11:16:52 AM
Gravatar
Total Posts 22

Re: Unable to add page content

Hi Joe,
sorry for being a pain in the neck...

I read chris_at's discover about PublishBegin in post http://www.mojoportal.com/ForumThreadView.aspx?thread=999&pageid=5&ItemID=2 and decided to investigate more on this issue.
It's a really bugging one because the panes in PageLayout.aspx are not update and thus the user starts filling the db with ghost items.

My understanding is that the panes are not updated because the newly created features have a "publish begin" attribute which still has to come.
This looks a lot like a timezone issue.

That's why I did not see the Welcome content: you created it on the 14th, I installed it the very same day, but due to the timezone difference the UTC BeginDate still had to come.
This morning I was of course able to see it.

After some trial and error experimentation, I found out that the "publish begin" field reported in the "Admin Menu > Content Manager > Publishing for.." page is a UTC time; being I in Italy I have a +2 time offset (GMT+1 + 1DST) and cannot see the new content after I edited; playing with the date value I come to the 2 hours threashold.

About the hour displayed in the page "Admin Menu > Content Manager > Publishing for..", I'm not sure what the expected behaviour of the server is,
should it show an UTC date (as it does now)?
should it show the time of the timezone of the server?
should it show the time of the timezone of the admin user?
probably the last one should be the best option.

anyway this is a minor issue; the worst is the PageLayout.aspx not getting updated.

What is not clear to me is how the BeginDate is set in the first place.
Is it 1.5h before the creation date?
When I create a html container, no new row is written in the mp_htmlcontent table, just one in mp_modules; in this case the indicated "Publish begin" datum seems to be 1/2h before row creation (not utc, but the header doesn't show up in the page).

hope this helps.

btw:
You said you were unable to reproduce the bug, did you try installing from scratch a MojoPortal site with italian local, browser language _and pc timezone_?

Federico

8/15/2007 12:13:29 PM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Federico,

I just sent you a new mojoPortal.Data.dll for Sqlite to see if it solves any of these time or localization issues.

Thanks,

Joe

8/15/2007 12:39:40 PM
Gravatar
Total Posts 18439

Re: Unable to add page content

I just added a page here http://www.mojoportal.com/timezonelocalization.aspx with information about how datetime is supposed to be handled and displayed in mojoPortal.

This should help clarify the expected behavior and therefore make it easier to point out and troubleshoot bugs.

Joe

8/15/2007 12:45:11 PM
Gravatar
Total Posts 22

Re: Unable to add page content

ah, that's explaining why I just was reading the page wondering why I did not notice it before!

I'm going to test the new dll

Federico

8/15/2007 12:56:06 PM
Gravatar
Total Posts 550

Re: Unable to add page content

Hi all

I so have this problem.I start to debug for find this bug.

A.Samarian

 

8/29/2007 7:08:25 AM
Gravatar
Total Posts 4

Re: Unable to add page content

Hi,

I can confirm this problem is to do with the publish date. Setting this date back a day in the mp_pagemodules table get the contents you add to show up :-). I guess you don't see this Joe because one of the date comparisons isn't being converted to local time correctly. I'll go and have a look now.

Having just downloaded and installed this application on a Win/MySql development system, I can also reoprt the old CreatedByUserID problem still exists for MySQL. For example, during setup this value isn't initialized in Default.aspx.cs when creating an initial module. When the mp_modules table is created with this database, the CreatedByUserID field is set as unsigned, and because the value isn't initialized in Default.aspx.cs (line 552 in 2.2.3.6), you try to insert -1 in the field.

Small issues (above) aside, this is a great piece of work, and I intend to spend a few days to see if we could use this frameowork for our business (which ultimately has to be deployed on Mono/Linux - still, I thought one step at a time!)

Many thanks

 

Allister

8/29/2007 7:39:36 AM
Gravatar
Total Posts 4

Re: Unable to add page content

Hi,

Further to above (unable to add page content), I have found the source of the bug (at least in MySQL). Line 7060 of dbPortal.cs (as of 2.2.3.6) should be:

arParams[4].Value = DateTime.UtcNow.AddMinutes(-30);

NOT

arParams[4].Value = DateTime.Now.AddMinutes(-30);

As you later compare against UTC (as you should) in getting the modules.

I hope this helps, and sorry I'm not experienced enoughh yet to submit this bug/correction directly.

Thanks again for a great product,

 

Allister

8/29/2007 8:16:29 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Allister,

Thanks for pinpointing this bug. I will fix it and upload a new mojoPortal.Data.dll for MySql later today. I'll post here again when the new file is available.

Thanks,

Joe

 

8/29/2007 9:30:15 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

I've uploaded a new datalayer for MySql as well as a new sourcecode file with fixes for both of these issues.

Thanks,

Joe

8/29/2007 10:35:49 AM
Gravatar
Total Posts 4

Re: Unable to add page content

Sorry to ask a stupid question, but when I browse the trunk repository(https://forgesvn1.novell.com/viewsvn/mojoportal/trunk/), the mojoPortal.Data.MySql folder shows it's still three days old, and the dbPortal.cs file is still revision 2654. Am I looking in the right place for the latest sources?

Thanks

Allister

8/29/2007 10:43:34 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Allister,

I've updated the zip downloads and I've updated my svn sandbox, https://forgesvn1.novell.com/svn/mojoportal/sandboxes/joeaudette

I will merge these changes to trunk by the end of the day.

Joe

12/24/2007 3:09:24 PM
ulu
Gravatar
Total Posts 22

Re: Unable to add page content

I'm still having this bug. I'm using the 2.2.3.9 release, my zone is GMT+3. I'm using MsSql server, so it shouldn't be related to the database.

For example, suppose now is 10pm. If I create a content directly from the page, using the pencil icon, the content appears on thу page immediately, and the PublishFrom says 7pm. If I create it through the Content Management page, it doesn't appear, and PublishFrom says 10pm.

I'm just starting to get familiar with Mojo (got frustrated with DotNetNuke and looking for something better), and I'm quite impressed! Is it really developed by a single person?

ulu

12/27/2007 8:25:56 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi ulu,

I'm looking into this now and I do see a difference in the way the dates are handled in ContentManager vs in page creation. I will fix this today to make it consistent. It will be fixed in svn trunk by tonight.

Glad to hear you like mojoPortal!

I think a lot of .NET developers still haven't heard about mojoPortal. Projects like DNN and Rainbow benefit from having their own forums on the asp.net site so they find out about those projects easier. However, when I inquired about getting a forum for mojoPortal there I was brushed off.

mojoPortal is not all developed by one person there have been many significant contributions of effort from other people and we also leverage the work of a lot of other open source projects. However it is fair to say that I have done quite a bit of the work myself and as far as I know I am the only one working on it full time.

Best,

Joe

3/15/2008 7:40:49 PM
Gravatar
Total Posts 15

Re: Unable to add page content

Hi Joe,

Love the product by the way.  I got latest a couple of days ago and using my 'dev' installation (rather than the 'release' version that's working fine), I found the same issue (content publish dates out of step) when working with MSSQL (2005 Express).

I'm in Australia and found that the Publish begin dates were actually being set to 'now', when inserted, but the criteria on selection was obivously based on UTC date.  I realised that adding content through pagelayout.aspx calls mp_Modules_Insert (which in turn does an inline insert to mp_PageModules.

This second insert takes the 'created date' as the PublishBeginDate which is passed into the proc. 

The root of this call is in mojoportal.Business.Module.Create.  I simply changed the createdate from DateTime.Now to DateTime.UtcNow (line 356).  Everything started working for me then.  This may cause some other issues, but I'll keep this in my local version until I spot any strangeness!  I think other methods of adding content may work fine as they may use slightly different procs.

Cheers,

Matt 

 

3/16/2008 4:19:07 AM
ulu
Gravatar
Total Posts 22

Re: Unable to add page content

By the way, this bug was fixed some time ago, but it reappeared recently. About a month ago, I downloaded the trunk version, installed it, and the prefilled content was missing!

May I humbly suggest that it would be cool to move all date-time management functionality into a separate class..

 

ulu

3/16/2008 6:50:54 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Matt,

Thanks for tracking it down, your change is correct and I will make the same one here.

 

Hi Ulu,

This is not a regression. This line of code was calling DateTime.Now but it should be and now is calling DateTime.UtcNow.

There is no way this line of code if it was somehow regressed (from working correctly before) could cause the probelm you describe of content disappearing after upgrade. This line of code only executes on creation of data so it can't affect existing data on an upgrade.

More likely this problem could be caused by the date time offset in Web.config was lost during upgrade. If you move any custom appSettings to user.config they will not be lost on upgrade.

Hope it helps,

Joe

12/9/2008 2:58:44 AM
Gravatar
Total Posts 4

Re: Unable to add page content

Hi Joe!

I've experienced same issues till found out my timezone was -4 instead of +3. By the way new two minor bugs were discovered in ContentManager (version 2.2.7.5 MSSQL).

The first one appears when content is already published and publication date is extracted from database and it is not adjusted from UTC to user's timezone. But when the user just saves publication settings this date is adjusted back to UTC as if it was user's local time. For me it works like substract 3 hours every time I save publication. But once someone has negative timezone offset acting this manner, the publication date will be increased by offset hours. So publication start date can even be in future for newly created content. The other side of the problem is publication end date which may be critical in some applications. And it is changed in the same manner.

The second bug: PageGuid of published content does not correspond to PageID in the mp_PageModules table. It seems like it is PageGuid of the first page of portal.

Regards,

Misha

12/9/2008 5:48:30 AM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Misha,

Yes, the first problem is it used the default time zone because you had not specified yours. I should probably make a checklist of steps to do after installation to clarify this, I will try to get to that soon.

If the default is set correctly and the user time zone is set correctly it all works as it should and dates are stored as utc and adjusted to user time zone for authenticated users and preferred time zone for not authenticated. It can also be a problem if the db is on a different machine and the time is not in sync with the web server time.

Thanks for letting me know about the pageguid bug, I will look into it. Its not causing any functional bug, but it needs to be fixed.

Best,

Joe

12/18/2008 9:47:56 AM
Gravatar
Total Posts 4

Re: Unable to add page content

Hi Joe,

But there is an error with ContentManager. Let me point it out.

Suppose we create new content. Next, add it to some page with begin time 10 a.m. We see time is adjusted to utc in the publishing table when we press "save". A little bit confusing, but ok. Next, open the publishing record we just added and see the begin time is not 10a.m. It's 7 a.m. for me (UTC+3).

Exactly the same thing happens with end date.

Let's look into the code.

Dates in the grid are placed in the dpBeginDate and dpEndDate date picker controls. dpBeginDate is bound to PublishBeginDate column using GetBeginDate(Eval("PublishBeginDate")). GetBeginDate looks like this
protected String GetBeginDate(Object o)
{
if((o == null)||(o.ToString() == String.Empty))
{
return DateTime.UtcNow.AddHours(timeOffset).ToString();
}

return o.ToString();

}
This function adjusts time only for empty value. This happens when content has not been published yet.
dpEndDate is bound to PublishEndDate using Bind("PublishEndDate").
When RowUpdating event occurs, DatePickers simply take their values from dpBeginDate and dpEndDate.
Are date adjusted before binding occurs? I’ve traced calls down to SQL. The answer is: no.

The fix is straightforward. But I’m not sure wether DateTime.Parse works ok if some cultures are mixed. But culture combinations are not supposed to happen, do they?

ContentManager.aspx.cs starting from line 268:
protected String GetBeginDate(Object o)
{
DateTime dt;
if ((o == null) || (o.ToString() == String.Empty))
dt = DateTime.UtcNow;
else dt = DateTime.Parse(o.ToString());

return ((DateTime)dt).AddHours(timeOffset).ToString();
}

protected String GetEndDate(Object o)
{
if ((o == null) || (o.ToString() == String.Empty))
return o.ToString();
return DateTime.Parse((string)o).AddHours(timeOffset).ToString();
}

ContentManager.aspx starting from line 65:
<asp:TemplateField HeaderText="">
<ItemTemplate>
<%# GetBeginDate(Eval("PublishBeginDate"))%>
</ItemTemplate>
<EditItemTemplate>
<mp:DatePickerControl id="dpBeginDate" runat="server" Text='<%# GetBeginDate(Eval("PublishBeginDate")) %>' ShowTime="True"></mp:DatePickerControl>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<%# GetEndDate(Eval("PublishEndDate"))%>
</ItemTemplate>
<EditItemTemplate>
<mp:DatePickerControl id="dpEndDate" runat="server" Text='<%# GetEndDate(Eval("PublishEndDate")) %>' ShowTime="True"></mp:DatePickerControl>
</EditItemTemplate>
</asp:TemplateField>


Hope this helps mojoportal become little better. :)
Sincerely,
Misha
 

12/18/2008 3:44:10 PM
Gravatar
Total Posts 18439

Re: Unable to add page content

Hi Misha,

I agree with your diagnosis and the fix. Thanks for your help.

I made the same changes here with minor variation of using Convert.ToDateTime instead of casting.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.