We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Required Category Extension

Development and Programming

gridonic's avatar
gridonic
231 posts
17 years ago
gridonic's avatar gridonic

Hey guys

Only one day later… 😉 I just finished creating this extension based on two posts here in the forums, you can check it out:

Required Category Extension

Feedback and bug reports are welcome.

       
Rob Quigley's avatar
Rob Quigley
236 posts
17 years ago
Rob Quigley's avatar Rob Quigley

Nice, I can use this, thanks!

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Another fantastic extension! 😉

Cheers for this. Never needed to do this before but I’m sure it will probably be needed sooner than later.

Great! 😊

Best wishes,

Mark

       
Laisvunas's avatar
Laisvunas
879 posts
17 years ago
Laisvunas's avatar Laisvunas

Hi peschehimself,

I installed and tried Required Category Extension; it works correctly.

But it seems that there is some issue with javascript - when I try to post an entry without assigning it to a category, Firebug shows this error

el_name has no properties
   if (el_name.substring(0,8)=='field_id') {

It is the line from this script:

<code>//<![CDATA[
form_elements = document.getElementById('entryform').elements;
var id_arr = new Array();
for(i=0; i<form_elements.length; i++) {

el = form_elements;
el_name = el.name;
toggle = 0;

if (el_name.substring(0,8)=='field_id') {</code>

This error began to appear when I installed Required category extension and set categories to be required for that particular weblog, so it seems that this error is somehow related to Required category extension.

       
gridonic's avatar
gridonic
231 posts
17 years ago
gridonic's avatar gridonic

Hi Laisvunas

Very strange as my extension does not modify or add any javascript to the CP.

Could you double check if it’s really my extension that’s causing the problem? Try deactivating all other extensions but Required Category and recheck. I checked it on our dev server and firebug does not throw any error on my side.

Cheers, Peter.

       
Laisvunas's avatar
Laisvunas
879 posts
17 years ago
Laisvunas's avatar Laisvunas

Hi Peter,

You are right. Javascript error is caused by Auto Collapse Empty Custom Fields extension v.1.1.

About this error I have posted an entry in this extension’s forum thread here.

       
gridonic's avatar
gridonic
231 posts
17 years ago
gridonic's avatar gridonic

Hi

Thanks for clarifying. In the other thread you posted that the Auto Collapse Empty Custom Fields only is buggy when used together with my extension. Are you sure? Did you try turning off every exension but the Auto Collapse? Can you try that?

As on my side, i don’t see anything that could / would clash with some other extension on the javascript side.

       
Cocoaholic's avatar
Cocoaholic
445 posts
17 years ago
Cocoaholic's avatar Cocoaholic

FYI thread updated

       
Laisvunas's avatar
Laisvunas
879 posts
17 years ago
Laisvunas's avatar Laisvunas

Hi,

When I edit weblog group preferences at CP Home › Admin › Weblog Administration › Weblog Management › Edit Weblog that is, assign weblog to category group or field group, I get this PHP notice (repeated twice):

Notice: Undefined offset: 0 in /www/eh5659/public_html/eesys/extensions/ext.dc_required_category.php on line 215

Notice: Undefined offset: 0 in /www/eh5659/public_html/eesys/extensions/ext.dc_required_category.php on line 215

Despite these notices weblog group preferences were updated correctly.

It seems that this is a small bug in Required category plugin.

       
gridonic's avatar
gridonic
231 posts
17 years ago
gridonic's avatar gridonic

Hi Laisvunas

I fixed the bug, please get the newest version here

http://www.designchuchi.ch/index.php/blog/comments/required-category-extension/

This bug only happenned if you use “Update & Finished” in the weblog administration and was only a minor bug.

Hope all works now, Peter.

       
Gabriel's avatar
Gabriel
130 posts
17 years ago
Gabriel's avatar Gabriel

Hi, I’m using SAEF. When the category is not choose, I get error:

Fatal error: Call to a member function new_entry_form() on a non-object in /www/website/public_html/admin/extensions/ext.dc_required_category.php on line 143

Thanks for the useful extension!

       
Gabriel's avatar
Gabriel
130 posts
17 years ago
Gabriel's avatar Gabriel

The extension works fine on 1.6.3 but I’m trying on 1.6.2 (build 20080206). When I want activate feature for a weblog, I get error:

MySQL ERROR:

Error Number: 1064

Description: 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 'ON DUPLICATE KEY UPDATE `weblog_id`=values(`weblog_id`), requir

Query: INSERT INTO exp_dc_required_cat VALUES('', '2', '1') ON DUPLICATE KEY UPDATE `weblog_id`=values(`weblog_id`), require_cat=values(`require_cat`)
       
gridonic's avatar
gridonic
231 posts
17 years ago
gridonic's avatar gridonic

What MySQL version are you on? This extension requires at least version 4.1.0

       
Gabriel's avatar
Gabriel
130 posts
17 years ago
Gabriel's avatar Gabriel

I’m running on MySQL 5.0.51a

       
Laisvunas's avatar
Laisvunas
879 posts
17 years ago
Laisvunas's avatar Laisvunas

Hi Peter,

Just tested new version. Everything now works correctly, without any PHP notices being thrown.

Thank you very much for excellent extension and debugging.

       
1 2 3

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.