google-code-export / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
2 stars 1 forks source link

Undefined index "rewrite_with_front" #455

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Create a new content type.
2. Go to the edit page, URLs tab.
3. Uncheck 'Rewrite with Permalink Front' checkbox.
4. Set 'Permalink action" to "Custom"

Just before the page section gets reloaded, there will be a notice about an 
undefined index.

Notice: Undefined index: rewrite_with_front in 
C:\httpdocs\wordpress\wp-content\plugins\custom-content-type-manager\includes\CC
TM_PostTypeDef.php on line 533

System information (development machine):
Windows 7,
Apache 2.4.3, Open SSL/1.0.1c
PHP 5.3.17
MySQL 5.5.27
Wordpress 3.5.1 (Plugins: Advanced Code Editor 2.2.4, CCTM 0.9.6.7, (disabled) 
WP Fire PHP 0.3 and a custom plugin)

Suggested quick fix: 
diff --git 
a/wp-content/plugins/custom-content-type-manager/includes/CCTM_PostTypeDef.php 
b/wp-content/plugins/custom-content-type-manager/includes/CCTM_PostTypeDef.php
index e53d01f..af98b02 100644
--- 
a/wp-content/plugins/custom-content-type-manager/includes/CCTM_PostTypeDef.php
+++ 
b/wp-content/plugins/custom-content-type-manager/includes/CCTM_PostTypeDef.php
@@ -530,7 +530,7 @@ class CCTM_PostTypeDef {
            break;
        case 'Custom':
            $sanitized['rewrite']['slug'] = $raw['rewrite_slug'];
-           $sanitized['rewrite']['with_front'] = (bool) $raw['rewrite_with_front'];
+           $sanitized['rewrite']['with_front'] = isset($raw['rewrite_with_front']) ? 
(bool) $raw['rewrite_with_front'] : FALSE;
            break;
        case 'Off':
        default:

Original issue reported on code.google.com by plamen.d...@gmail.com on 11 Feb 2013 at 2:00

GoogleCodeExporter commented 9 years ago
Thanks for the tip -- code submitted. Committed revision 666377.

Original comment by fireproofsocks on 11 Feb 2013 at 4:05

GoogleCodeExporter commented 9 years ago
Awesome! Thanks for the quick response.

Original comment by plamen.d...@gmail.com on 11 Feb 2013 at 4:22