2 of 2
2
Required Category Extension
Posted: 07 June 2008 02:23 AM   [ Ignore ]   [ # 19 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Glad it’s working, just yesterday, I added SAEF support (in the 1.0.1 version not supported). I will be testing this through the weekend and make it public when everything goes well.

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 09 June 2008 08:13 AM   [ Ignore ]   [ # 20 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Updated the extension to make it work with SAEFs.

Hope all works, tested by different parties a few times.

Enjoy!

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 23 June 2008 01:35 PM   [ Ignore ]   [ # 21 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Hi All

I just added another functionality to the extension.

You can now chose, in weblog administration, not only to require a category entry, but also to limit the entry to only one category per post.

Until the extension version gets updated in the official EE repository, you can download it from our website.

Please report back should you encounter any bugs.

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 24 June 2008 02:16 AM   [ Ignore ]   [ # 22 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  284
Joined  02-02-2007

Hi Peter,

Limiting to only one category per post is a very useful feature. But it can be similar situations when there might be a need for limiting to no more than two or three etc. categories per post.

It seems to me that instead of to having a pair of radio boxes for choosing to limit or not to only one category per post the better solution would be to have an input field for entering a number or a selectbox with options 1, 2, 3 etc. to select a number which would set a limit.

 Signature 

Full list of plugins here

Child Categories
Browser Sniff
Category Id
Entries List

Profile
 
 
Posted: 31 July 2008 11:51 AM   [ Ignore ]   [ # 23 ]  
Summer Student
Avatar
Total Posts:  10
Joined  05-13-2008
Laisvunas - 24 June 2008 02:16 AM

Hi Peter,
...the better solution would be to have an input field for entering a number or a selectbox with options 1, 2, 3 etc. to select a number which would set a limit.

That would be terrific! smile

Profile
 
 
Posted: 12 August 2008 10:25 AM   [ Ignore ]   [ # 24 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Hey Guys

We just updated the required category extension and added some new, cool features.

* Added category maximum feature
* Added exact category number feature

Thanks to those who helped by providing ideas on how to improve this extension.

Be sure to check it out and report back should you encouter any bugs!

Cheers
Peter

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 12 August 2008 10:53 AM   [ Ignore ]   [ # 25 ]  
Summer Student
Avatar
Total Posts:  10
Joined  05-13-2008

Super!

How about this for a suggestion: Limiting # of categories dependent on member group. :D

I know, I know. :D I’m thrilled with this as it is, don’t go crazy!

Profile
 
 
Posted: 13 August 2008 06:30 AM   [ Ignore ]   [ # 26 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  284
Joined  02-02-2007

Hi Peter,

Thanks very much for upgrade of this excellent extension!

I have noticed only a minor problem.

Say, for some weblog we have such preferences:

1) Posts in this weblog require at least one category? - Yes;

2) Maximum number of categories - 2;

3) Number of categories has to equal the maximum - Yes.

Then if we try to submit an entry after assigning it only to one category, we will get two error messages:

* Posts in this weblog must have at least one category associated with them.
*
Posts in this weblog must have exactly 2 categories associated with them.

In this case only the second error message is needed.

 Signature 

Full list of plugins here

Child Categories
Browser Sniff
Category Id
Entries List

Profile
 
 
Posted: 13 August 2008 06:39 AM   [ Ignore ]   [ # 27 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Hi

Then if we try to submit an entry after assigning it only to one category, we will get two error messages:

Did you mean when using those settings and tryting to submit the entry WITHOUT ANY category assigned?

I just tested it and indeed and also by looking at the code, if you don’t chose any category and try to submit the entry, you will get those two errors.

If you select one category, you only should get the second error.

Of course you’re right and only one error is needed in the case I have a limit set and it’s not fulfilled. This will be fixed in the next release.

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 23 October 2008 07:07 AM   [ Ignore ]   [ # 28 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  160
Joined  03-04-2008

First of all, apologies, as I have already posted this bug report in the comments section of the developers blog, but wanted to post here as well just in case it got missed…

Hi, I am using this extension in several of my weblogs successfully. However, In one of my weblogs, I have 2 custom date fields, one for start date and one for end date. I have your extension installed and set to require at least one category to be selected before posting.

If I publish a new entry and choose a start and end date without selecting a category and try to publish, when the error message comes up, and I go back to my date fields, they have all reset to 1970 and a random time. If I don’t notice this, and add the required category and then update the entry then the wrong dates show.

I presume this to be a bug because when I turn off the required category for this weblog, the problem goes away. Obviously It only goes away because it no longer requires me to enter a category…

This has already caused problems for my client…. so for now, I have to keep the required category setting turned off, and hope that the client remembers to add the entry to the right category before publishing…

Any chance you could look into this bug as this extension is truly GREAT at what it does in general.

Many thanks

 Signature 

Richard Angstmann
Film & Video, Web Design, eCommerce | Gloucester | Cheltenham | Forest of Dean

Profile
 
 
Posted: 23 October 2008 07:18 AM   [ Ignore ]   [ # 29 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Hi Richard

We’ll look into it as soon as possible, we’re currently pretty busy with some client work but we’ve received your report.

Regards
Peter.

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 23 October 2008 07:20 AM   [ Ignore ]   [ # 30 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  160
Joined  03-04-2008

Thanks very much for the swift reply!  Look forward to seeing the bug squashed smile

 Signature 

Richard Angstmann
Film & Video, Web Design, eCommerce | Gloucester | Cheltenham | Forest of Dean

Profile
 
 
Posted: 23 October 2008 09:30 AM   [ Ignore ]   [ # 31 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Hi Richard

We seem to have identified what’s causing the problem. It seems that the misbehaviour is in one of the EE core files.

We’re triggering the error based on the categories posted in one of our hooks and are showing it by using the new_entry_form function:

$EE->new_entry_form('preview', '<ul><li>'.implode('</li><li>',array_filter($errors)).'</li></ul>');
$EXT->end_script = TRUE;

At around the line 2876 in cp.publish.php, the following code handles EE date fields:

if ($dtwhich != 'preview' OR $submission_error != '')
{    
    $localize
= TRUE;

    
print_r($field_data);

    if (
$field_data != '' AND isset($result))
    
{
        
if (isset($result->row['field_dt_'.$row['field_id']]) AND $result->row['field_dt_'.$row['field_id']] != '')
        
{                        
            $field_data
= $LOC->offset_entry_dst($field_data, $dst_enabled);
            
$field_data = $LOC->simpl_offset($field_data, $result->row['field_dt_'.$row['field_id']]);
            
$localize = FALSE;
        
}
    }

    
if ($field_data != '')
        
$custom_date = $LOC->set_human_time($field_data, $localize);
    
    
$cal_date = ($LOC->set_localized_time($field_data) * 1000);
}
else
{                
    $custom_date
= $_POST[$date_field];
    
$cal_date = ($custom_date != '') ? ($LOC->set_localized_time($LOC->convert_human_date_to_gmt($custom_date)) * 1000) : ($LOC->set_localized_time() * 1000);
}

Now, the date from your custom date field is passed along to this functon corretly, it’s correclty in the $_POST var and also in this function, the troublemaker now are the following lines:

if ($field_data != '')
        
$custom_date = $LOC->set_human_time($field_data, $localize);

$field_data contains the correnct date (something like 2008-10-23 05:19 PM for example), the function $LOC->set_human_time being called with the $field_data value for the date field however returns always 1970-01-01 03:33 AM which is also the value being shown in the date’s text field.

Seems that $custom_date is always 1970-01-01 03:33 AM in that case.

Changing those lines to

if ($field_data != '')
        
$custom_date = $field_data;

correctly renders the date in the date’s text field as now the value of $custom_date is the actual posted value.

However, we should definitely get a word from the core developers on this as it seems that the set_human_time function renders the wrong date? Are we missing something?

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 23 October 2008 09:43 AM   [ Ignore ]   [ # 32 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  160
Joined  03-04-2008

Thanks very much Peter for looking into the problem. It seems like you have made a lot of progress in identifying the problem. Just a shame that it appears to be a problem that you personally can’t solve. So, I too look forward to some feedback from the folks at EE with regards to this!

Thanks again

 Signature 

Richard Angstmann
Film & Video, Web Design, eCommerce | Gloucester | Cheltenham | Forest of Dean

Profile
 
 
Posted: 23 October 2008 12:09 PM   [ Ignore ]   [ # 33 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  160
Joined  03-04-2008

Hi Peter, I thought I would point you to a thread in Tech Support relating to some other time bugs I have been having with Custom Date fields. As it turns out they appear to have been ironed out but only after completely removing the Required Category extension from my site.

Take a look: http://expressionengine.com/forums/viewthread/94734/

 Signature 

Richard Angstmann
Film & Video, Web Design, eCommerce | Gloucester | Cheltenham | Forest of Dean

Profile
 
 
Posted: 27 November 2008 11:06 AM   [ Ignore ]   [ # 34 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  284
Joined  02-02-2007

Hi Peter,

There is a problem experienced when Required Category extension is used with nested categories.

Let me describe it in general terms.

Suppose:

1) the weblog “My Weblog” has category group such as this:

Category A (level 1)
Category B (level 2)
Category C (level 2)
Category d (level 2)

2) the weblog “My Weblog” has following Required Category settings:

Posts in this weblog require at least one category? - No.
Maximum number of categories - 1.
Number of categories has to equal the maximum - Yes.

3) the entry “My Entry” was posted into the weblog “My Weblog” and assigned to Category C which is subcategory of Category A.

4) the entry “My Entry” was opened, some corrections was made and the button “Submit” was pressed.

The result is two error warnings:

Posts in this weblog cannot have more than one category associated with them.
Posts in this weblog must have exactly one category associated with them.

These error warnings are being displayed because the entry “My Entry” was automatically assigned to Category A which is parent category of Category C.

In this case the content author must open Categories tab and assign entry only to Category C. This is quite confusing to content authors. It would be better if Required Category Extension took account of parent category/subcategory relationship in such cases. That is, it seems to me that if an entry is assigned to two categories and one category is the parent of the other category, the Required Category extension should treat such assignment as assignment to one category.

 Signature 

Full list of plugins here

Child Categories
Browser Sniff
Category Id
Entries List

Profile
 
 
   
2 of 2
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64908 Total Logged-in Users: 37
Total Topics: 81852 Total Anonymous Users: 16
Total Replies: 440062 Total Guests: 230
Total Posts: 521914    
Members ( View Memberlist )