Coranto 1.30.3 is out

Archive of notes and cross input on Dev versions of Coranto (1.25.1 and Older)

Moderators: Dale Ray, SrNupsen, Bluetooth, Jackanape

Postby Parahead » Tue Apr 13, 2004 7:27 am

Just would like to point out a small change between version 1.23 and the 1.30.x series that any addon developer that uses the hook BuildNews_Filtering2 should be aware of...

In crcore.pl, just a couple of lines above the hook BuildNews_NewType_Open the call to CRopen is commented out. I assume that the goal is to speed up the building process and quite correct the call really isn´t needed, but since it has previously been there it can cause some problems for addons that don´t take this into account...

The thing is the "v120 profile fix", which includes the use of $countnews{$i}, which in turn is used to determain if the outputfile from the profile should be opened with ">" (overwrite) or ">>" (append). If there is an addon that use the hook BuildNews_Filtering2 and filters the *first* newsitem, the check to overwrite or append later on in BuildNews is not working as intended and the incorrect choice to append is made, which will make the previous build not being overwritten and make things look a bit funny...

It is easy to solve if the addon that uses the hook BuildNews_Filtering2 and actually do filters out a newsitem then also decrement $countnews{$i} by one.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Parahead » Tue Apr 13, 2004 7:37 am

Parahead wrote:Just would like to point out a small change between version 1.23 and the 1.30.x series that any addon developer that uses the hook BuildNews_Filtering2 should be aware of...
If any filtering of newsitems is done in the hooks BuildNews_Filtering or BuildNews_StandardProfile they are also effected...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Parahead » Thu Apr 15, 2004 1:39 pm

A bugreport for 1.30.3:
In crcore.pl, do a search for "print news controls or bottom links", a couple of lines below that there is an if/else-statement either appending to or overwriting the file it is opening depending if it is the first newsitem or not. Since the purpose of opening the file at that point is not the same as when this if/else approach is used elsewhere in the BuildNews-sub this should be replaced with only the append part:

Code: Select all
$FilesOpened{$i} = CRopen(">>$ProfFilePath{$i}/$newsprofiles{$i}->{'textfile'}");

The bug only appears if there is one newsitem in that profile and another sorting then the default is used, but at that time it is overwritten...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Parahead » Wed May 12, 2004 7:21 pm

Don´t know if I should call it a bug, but it is a change between version 1.23 and 1.30.x which needs to be either corrected or documented, preferably the first option...

It is not a single issue, but they are all located near the hook BuildNews_CloseFile in crcore.pl. The first issue is that this hook has changed place. Previously it was placed before the generated files where closed but now is located *after* the files has been closed. This is a major change if an addon has been using this hook and expect the outputfiles to be open...

Also, the while-loop surrounding the BuildNews_CloseFile hook previously looked like this:
Code: Select all
while (($key, $value) = each %FilesOpened) {

but now it looks like this:
Code: Select all
while (($i, $value) = each %FilesOpened) {

I understand the reason for this, but it isn´t very backwards friendly... Also, in order to be backward friendly, the variable $value should be loaded with $FilesOpened{$i} after the "1.30.x approach" of open files...

Eh, what the heck, I modify the while-loop from 1.30.3 in the way I think it should look like and provide it here instead:
Code: Select all
foreach $key (keys %FilesOpened) {
 my $br = ($CConfig{'XHTMLbr'} ? '<br />' : '<br>');

 $FilesOpened{$key} = CRopen(">>$ProfFilePath{$key}/$newsprofiles{$key}->{'textfile'}");
 
 $value = $FilesOpened{$key};
      
 # HOOK: BuildNews_CloseFile
 if($Addons{'BuildNews_CloseFile'}){my $w;foreach $w (@{$Addons{'BuildNews_CloseFile'}}){my $addon=$w->[2];eval ${$w->[0]};AErr($addon,$@)if $@;};}

 if ($newsprofiles{$key}->{'DisplayLink'} == 1) {
  print {$FilesOpened{$key}} qq~$br<i><small>$Messages{'DisplayLink'} <a href="http://coranto.org" target="_blank">Coranto</a></small></i>$br~;
 }
 elsif ($newsprofiles{$key}->{'DisplayLink'} == 2) {
  print {$FilesOpened{$key}} qq~$br<i><small>$Messages{'DisplayLink'} <a href="http://coranto.org/forum" target="_blank">Coranto</a></small></i>$br~;
 }
 elsif ($newsprofiles{$key}->{'DisplayLink'} == 3) {
  print {$FilesOpened{$key}} qq~$br<i><small>$Messages{'DisplayLink'} Coranto</small></i>$br~;
 }
 close ($FilesOpened{$key});

}#while fileopened

This modified code also fixes the bug I reported just above, about the "one newsitem with another sorting overwrite problem"...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby cerberos76_ » Thu May 13, 2004 1:03 am

Thanks for reporting it parahead. Yes you are right about the backcompatibility which should be maintained.

Have you had a chance to do some testing on the code given? I mean try with different profiles mixing categories of differnt types and so on?
Coranto addons:
* GuestPost, one click guestposting
* MoveIt!, Advanced Backup and site transfer
* PartialRebuild, CPU-friendly enhancement of FullBuild
* URLColumn, URLs for multiple Categories/Profiles
* Tickit!, Javascript News Tickers/Faders for Coranto!
* AddonEnabler, enables or disables single, multiple or all addons in one go
* SubmitMultiple, post consecutive news in an automatic loop!
* RSSAdvanced, RelatedNews ....

Get them at: http://coranto.gweilo.org/addons/
cerberos76_
 
Posts: 1339
Joined: Sun Mar 10, 2002 1:21 am

Postby Parahead » Thu May 13, 2004 7:16 am

cerberos76 wrote:Have you had a chance to do some testing on the code given? I mean try with different profiles mixing categories of differnt types and so on?
Actually I made a decision earlier to become a betatester and start using the 1.30.3 on my site, where I have a bunch of profiles and categories. I also have a bunch of addons enabled...

But I don´t know exactly what you mean by mixing categories of different types? This particular codesnippet is only related to the printing of the link to CTUS at the bottom, which is a feature I don´t use on my site (instead have a "free" link better incorporated into the design), so I can´t say that it is *that* much tested, but the while loop is processed regardless and that part works...

BTW, all my bugreports and other changes I have posted in these forums regarding 1.30.3 I have also documented in my copy, so if you are interested I could send you those files... My modified version includes:
* The fix mentioned above with the link loop and BuildNews_CloseFile-hook
* Better sorting of profiles (True alpha of displayname)
* Better sorting of styles (True alpha of displayname)
* Being able to sort headlines differently than the profile they belong to
* StackTrace feature as pointed out by LoneOwl
* Autofocus at the loginpage (yes, I know, we have discussed this before)
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby cerberos76_ » Thu May 13, 2004 1:51 pm

Yes, thanks for the offer.
Please be welcome to send me your bug-fixed files. I appreciate that and will soon check them and put them out as a new release.

The question on testing I asked was because I had reports from testers that sometimes the build process of 1.30.3 was not correct.
In particular I meant do the building (and in particular Partial Build) of separate profiles containing different categories, making sure there are categories contained in many profiles (not simply a 1:1 mapping category:profile).
I was unable to reproduce the problem and I always promised to do more testing with a more real-life environment to find the bug.
I guess the bug you pointed out (the if/then write/append in the main loop) might have been responsible for the problem in particular cases.

So, I will do some testing as I receive the files.
Coranto addons:
* GuestPost, one click guestposting
* MoveIt!, Advanced Backup and site transfer
* PartialRebuild, CPU-friendly enhancement of FullBuild
* URLColumn, URLs for multiple Categories/Profiles
* Tickit!, Javascript News Tickers/Faders for Coranto!
* AddonEnabler, enables or disables single, multiple or all addons in one go
* SubmitMultiple, post consecutive news in an automatic loop!
* RSSAdvanced, RelatedNews ....

Get them at: http://coranto.gweilo.org/addons/
cerberos76_
 
Posts: 1339
Joined: Sun Mar 10, 2002 1:21 am

Postby Parahead » Thu May 13, 2004 6:19 pm

cerberos76 wrote:Yes, thanks for the offer.
Please be welcome to send me your bug-fixed files. I appreciate that and will soon check them and put them out as a new release.
It´s in the mail... Like I said in the mail, I use this version at my site, so it may contain things that you do not which to include in an official release, I don´t want to upset LoneOwl by including JS into the core... ;-)

cerberos76 wrote:The question on testing I asked was because I had reports from testers that sometimes the build process of 1.30.3 was not correct.
The problems I have encountered have been fixed with my modifications, but I can ofcourse not make any guaranties that I have discovered the same problem as other testers... I don´t have any profiles using multiple categories currently but I can do some testing regarding this, I saw a description of when this problem occured in one of the other 1.30-threads I think, I´ll let you know if I run into anything...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Lawrence » Thu May 13, 2004 9:20 pm

Based on your previous submissions, I don't doubt that the fixes are good :)
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby Groterra » Fri May 21, 2004 3:24 am

Parahead patch to coranto 130.3 doesn't fix bug that appends in each build same headlines to existing headlines in some txt profiles, rather than overwritten. I have workarounded this bug in some profiles by selecting Maginot "Unsorted (Default Chronological) for Interliking" sort order, despite profiles be standard not Maginot. But that approach doesn't work with some profiles. All profiles have multiples categories and one filtering.

Ex:
Subject 1
Subject 2

If you do a full rebuild:

Subject 1
Subject 2
Subject 1
Subject 2

If you do another full rebuild:

Subject 1
Subject 2
Subject 1
Subject 2
Subject 1
Subject 2
Groterra
 
Posts: 79
Joined: Fri Feb 23, 2007 12:14 am

Postby Parahead » Fri May 21, 2004 6:27 am

groterra wrote:Parahead patch to coranto 130.3 doesn't fix bug that appends in each build same headlines to existing headlines in some txt profiles, rather than overwritten. I have workarounded this bug in some profiles by selecting Maginot "Unsorted (Default Chronological) for Interliking" sort order, despite profiles be standard not Maginot. But that approach doesn't work with some profiles. All profiles have multiples categories and one filtering.
Could you please give a more precise example of the settings for a profile that do work and another that doesn´t, filter settings and such? Also, if you filter by time or something, please give some examples of newsitems postingtime so we can see if any are filtered out or not...

You see, I have tried to replicate this in my own environment, using several categories, using a different sorting than the default, setting filtering and so on, without being able to get it to behave so that it owerwrites the generated headline file. NOTE: I also have implemented the solution to sort headlines in a different way than the profile it belongs to, described in this thread. That should not take care of this kind of problem though, but untill we know the cause why you get this problem we can´t rule anything out...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Groterra » Sat May 22, 2004 3:15 am

I have made a mistake. It's not headlines as posted in above thread but subjects. I have created some txt profiles using Filter by Field 2 addon to include in index page by SSI. Some txt profiles disclosed the bug, but HTML files associated with these profiles didn't disclose the bug. Text profiles have been built correctly without use of Filter by Field 2 addon. I think some changes in coranto 130 conflict with Filter by Field 2 addon.

Results of tests I made:

profile 1 - filter by time and number and 1 (one) filtering by Filter by field2, multiples categories, headlines disabled. Sort order = Default (Reverse Chronological). Appends in each build same subjects to existing subjects in txt profile, rather than overwritten.
profile 2 - filter by time and number and 1 (one) filtering by Filter by field2, multiples categories, headlines disabled. Sort order = Maginot Unsorted (Reverse Chronological) for interliking. No problem.
profile 3.1 - filter by time and number and 2 (two) filtering by Filter by field2, multiples categories, headlines disabled. Sort order = Maginot Unsorted (Reverse Chronological) for interliking. No problem.
profile 3.2 - filter by time and number and 2 (two) filtering by Filter by field2, multiples categories, headlines disabled. Sort order = Default (Reverse Chronological). No problem.
Groterra
 
Posts: 79
Joined: Fri Feb 23, 2007 12:14 am

Postby Parahead » Sat May 22, 2004 12:27 pm

groterra wrote:I have made a mistake. It's not headlines as posted in above thread but subjects. I have created some txt profiles using Filter by Field 2 addon to include in index page by SSI. Some txt profiles disclosed the bug, but HTML files associated with these profiles didn't disclose the bug. Text profiles have been built correctly without use of Filter by Field 2 addon. I think some changes in coranto 130 conflict with Filter by Field 2 addon.
A quick look into the Filter by Field 2 addon makes me certain that the problem is because of this thing I mentioned a couple of posts up in this thread. I *think* this bug (yes, I would say bug) in Coranto can be fixed by moving the two lines of code where the incrementing in crcore.pl is done to another place (right before the file opening test). I will do some investigation about this and get back to you...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Parahead » Sat May 22, 2004 1:03 pm

Yeah, the solution is to move the incrementation from one place to another... I can´t see any reason for this to conflict with anything, but since cerberos76 and Lawrence has been poking around in this particular area to speed up the building process I might have overlooked something. Anyway, I have done this modification in my version and is not experiencing any problems, any modification is up to you though and always do a backup before doing anyting...

In crcore.pl, find the three *separate* lines below and remove them (or comment out):
Code: Select all
$countnews{$i}++;
my $profcountnews=$countnews{$i};
$countfiltnews{$i}++;

Then you find the line:
Code: Select all
if ($profcountnews==1) {$FilesOpened{$i} = CRopen(">$ProfFilePath{$i}/$newsprofiles{$i}->{'textfile'}");}

And change that to:
Code: Select all
if (++$countnews{$i}==1) {$FilesOpened{$i} = CRopen(">$ProfFilePath{$i}/$newsprofiles{$i}->{'textfile'}");}

And the line:
Code: Select all
if ($countfiltnews{$i}==1) {$FilesOpened{$i} = CRopen(">$ProfFilePath{$i}/$newsprofiles{$i}->{'textfile'}");}

should be changed to:
Code: Select all
if (++$countfiltnews{$i}==1) {$FilesOpened{$i} = CRopen(">$ProfFilePath{$i}/$newsprofiles{$i}->{'textfile'}");}


Let us know if that take care of your problems or if you run into anything...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby cerberos76_ » Sat May 22, 2004 9:47 pm

One side effect of this fix is that if Profile is not Standard, then the value of $countnews{$i} is wrong.

If an addon hooks in here:
# HOOK: BuildNews_ProfileType

and tries to use that same variable for some speed up or other tricks, it will be tricked in finding its value is wrong. ($countnews{$i} should return the number of news processed/built for that profile at any given time; it was put at the top of the build process to count all news...).

The increment of that counter with Parahead latest fix is done not for each news on each profile but only when that particular if gets called... which is only for standard profiles in crcore.pl (at the moment). This results in the counter being wrong for all other profiles

I will think to some cleaner solution, but as a temporary fix should work.
Coranto addons:
* GuestPost, one click guestposting
* MoveIt!, Advanced Backup and site transfer
* PartialRebuild, CPU-friendly enhancement of FullBuild
* URLColumn, URLs for multiple Categories/Profiles
* Tickit!, Javascript News Tickers/Faders for Coranto!
* AddonEnabler, enables or disables single, multiple or all addons in one go
* SubmitMultiple, post consecutive news in an automatic loop!
* RSSAdvanced, RelatedNews ....

Get them at: http://coranto.gweilo.org/addons/
cerberos76_
 
Posts: 1339
Joined: Sun Mar 10, 2002 1:21 am

PreviousNext

Return to Coranto Development Archives -- 1.25.1 and Older

Who is online

Users browsing this forum: No registered users and 1 guest

cron