Foren / Cotonti / Support / Extra Fields (Pages) error

12NächsteLetzte

Twiebie
#1 23. Oktober 2011, 14:17

Experiencing the following errors in the admin panel where I try to add custom fields for pages:

 Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 266
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.0843 8327616 cot_generate_pagetags( ) ..\recentitems.functions.php:213
( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 274
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.0843 8327616 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 266
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.0961 8693776 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 274
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.0961 8693776 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 266
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.0994 8708312 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 274
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.0994 8708312 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 266
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.1080 8725504 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 274
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.1080 8725504 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 266
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.1116 8740752 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 274
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.1116 8740752 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 266
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.1150 8755808 cot_generate_pagetags( ) ..\recentitems.functions.php:213

 

( ! ) Warning: Invalid argument supplied for foreach() in S:\Webserver\wamp\www\goat\modules\page\inc\page.functions.php on line 274
Call Stack
# Time Memory Function Location
1 0.0004 686464 {main}( ) ..\admin.php:0
2 0.0500 7721104 include( 'S:\Webserver\wamp\www\goat\system\admin\admin.main.php' ) ..\admin.php:25
3 0.0769 7945080 require_once( 'S:\Webserver\wamp\www\goat\system\footer.php' ) ..\admin.main.php:105
4 0.0780 7978496 include( 'S:\Webserver\wamp\www\goat\plugins\recentitems\recentitems.index.php' ) ..\footer.php:84
5 0.0795 8121024 cot_build_recentpages( ) ..\recentitems.index.php:29
6 0.1150 8755808 cot_generate_pagetags( ) ..\recentitems.functions.php:21

I'm running Siena 0.9.5 (up to date with GitHub), patched from Genoa 0.6.20.

GHengeveld
#2 23. Oktober 2011, 15:03

Check your page.functions.php. Are you sure it references $cot_extrafields[$db_pages] and $cot_extrafields[$db_structure] instead of $cot_extrafields['pages'] and $cot_extrafields['structure'] ? I think your bug is related to this change.

I was unable to reproduce this bug.

Twiebie
#3 23. Oktober 2011, 15:24

Yes, it's definitely the same - i'm completely up to date with the latest changes on GitHub.

 

 

esclkm
#4 23. Oktober 2011, 15:39

if cache is cleared?

and on the clean install if there any same errors?

do you use any exflds?

littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
Twiebie
#5 23. Oktober 2011, 16:20

Cache is cleared.

It's fine on a clean install, the problem is occuring on a website that is updated from Genoa 0.6.20.

Yes, i'm using extra fields. They are still in the database, but it appears that they haven't been picked up when updating to Siena 0.9.5.

esclkm
#6 23. Oktober 2011, 16:43

please give me your exld table dump

littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
Twiebie
#7 23. Oktober 2011, 16:50
--
-- Table structure for table `sed_extra_fields`
--

CREATE TABLE IF NOT EXISTS `sed_extra_fields` (
  `field_location` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `field_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `field_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `field_html` text COLLATE utf8_unicode_ci NOT NULL,
  `field_variants` text COLLATE utf8_unicode_ci NOT NULL,
  `field_description` text COLLATE utf8_unicode_ci NOT NULL,
  `field_default` text COLLATE utf8_unicode_ci NOT NULL,
  `field_required` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `field_parse` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'HTML',
  `field_params` text COLLATE utf8_unicode_ci NOT NULL,
  `field_enabled` tinyint(1) unsigned NOT NULL DEFAULT '1',
  KEY `field_location` (`field_location`),
  KEY `field_name` (`field_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `sed_extra_fields`
--

INSERT INTO `sed_extra_fields` (`field_location`, `field_name`, `field_type`, `field_html`, `field_variants`, `field_description`, `field_default`, `field_required`, `field_parse`, `field_params`, `field_enabled`) VALUES
('pages', 'nick', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('users', 'extra2', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('users', 'extra3', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('users', 'extra4', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('users', 'extra5', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('users', 'extra6', 'textarea', '<textarea name="{$name}" rows="{$rows}" cols="{$cols}"{$attrs}>{$value}</textarea>{$error}', '', '', '', 0, 'HTML', '', 1),
('users', 'extra7', 'textarea', '<textarea name="{$name}" rows="{$rows}" cols="{$cols}"{$attrs}>{$value}</textarea>{$error}', '', '', '', 0, 'HTML', '', 1),
('users', 'extra8', 'textarea', '<textarea name="{$name}" rows="{$rows}" cols="{$cols}"{$attrs}>{$value}</textarea>{$error}', '', '', '', 0, 'HTML', '', 1),
('users', 'extra9', 'textarea', '<textarea name="{$name}" rows="{$rows}" cols="{$cols}"{$attrs}>{$value}</textarea>{$error}', '', '', '', 0, 'HTML', '', 1),
('pages', 'guid', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('pages', 'ipaddress', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('pages', 'violation', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('pages', 'server', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('pages', 'viotime', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('pages', 'viodate', 'select', '<select name="{$name}"{$attrs}>{$options}</select>{$error}', '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31', '', '', 0, 'HTML', '', 1),
('pages', 'viomonth', 'select', '<select name="{$name}"{$attrs}>{$options}</select>{$error}', 'January,February,March,April,May,June,July,August,September,October,November,December', '', '', 0, 'HTML', '', 1),
('pages', 'vioyear', 'select', '<select name="{$name}"{$attrs}>{$options}</select>{$error}', '2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030', '', '', 0, 'HTML', '', 1),
('pages', 'viohours', 'select', '<select name="{$name}"{$attrs}>{$options}</select>{$error}', '00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24', '', '', 0, 'HTML', '', 1),
('pages', 'viomin', 'select', '<select name="{$name}"{$attrs}>{$options}</select>{$error}', '00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60', '', '', 0, 'HTML', '', 1),
('pages', 'viotimezone', 'select', '<select name="{$name}"{$attrs}>{$options}</select>{$error}', 'GMT-0,GMT-1,GMT-2,GMT-3,GMT-4,GMT-5,GMT-6,GMT-7,GMT-8,GMT-9,GMT-10,GMT-11,GMT-12,GMT+0,GMT+1,GMT+2,GMT+3,GMT+4,GMT+5,GMT+6,GMT+7,GMT+8,GMT+9,GMT+10,GMT+11,GMT+12', '', '', 0, 'HTML', '', 1),
('pages', 'vioserver', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('pages', 'vioserverip', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'HTML', '', 1),
('cot_users', 'icq', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'Text', '', 1),
('cot_users', 'msn', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'Text', '', 1),
('cot_users', 'irc', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'Text', '', 1),
('cot_users', 'website', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'Text', '', 1),
('cot_users', 'location', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'Text', '', 1),
('cot_users', 'occupation', 'input', '<input type="text" class="text" name="{$name}" value="{$value}"{$attrs} />{$error}', '', '', '', 0, 'Text', '', 1);
esclkm
#8 23. Oktober 2011, 17:18

make UPDATE sed_extra_fields SET field_location = 'sed_pages' WHERE field_location = 'pages'

UPDATE sed_extra_fields SET field_location = 'sed_users' WHERE field_location = 'users'

littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
GHengeveld
#9 23. Oktober 2011, 17:33

Actually it appears there's another bug there too. You have some records with field_location = cot_users, while that should probably be sed_users since you're using the old prefix for your tables. I'm assuming these records were added after you migrated.

esclkm
#10 23. Oktober 2011, 17:55

I mess understand about prefixes sed or cot which one?

littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
Twiebie
#11 23. Oktober 2011, 18:08
#31110 esclkm:

make UPDATE sed_extra_fields SET field_location = 'sed_pages' WHERE field_location = 'pages'

UPDATE sed_extra_fields SET field_location = 'sed_users' WHERE field_location = 'users'

Sorry, I lost you there a bit - can you elaborate that?

#31112 GHengeveld: 

Actually it appears there's another bug there too. You have some records with field_location = cot_users, while that should probably be sed_users since you're using the old prefix for your tables. I'm assuming these records were added after you migrated.

I think those 'cot_users' entries were added in the migration process? I haven't added them manually.

 

esclkm
#12 23. Oktober 2011, 18:09

Its SQL queryies which you need enter in your php my admin

littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
Twiebie
#13 23. Oktober 2011, 18:15
#31116 esclkm:

Its SQL queryies which you need enter in your php my admin

Ok, that brought back the old entries.

I'm still having the same error as posted above though.

esclkm
#14 23. Oktober 2011, 18:38

page.functions.php :

foreach ($cot_extrafields[$db_pages] as $row) -258

foreach ($cot_extrafields[$db_structure] as $row) - 266

foreach ($extp_main as $pl) -274

have you same?

and config.php - debug mode turn  TRUE

than make cot_print($cot_extrafields);

 

littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
Twiebie
#15 23. Oktober 2011, 18:44
#31120 esclkm:

page.functions.php :

foreach ($cot_extrafields[$db_pages] as $row) -258

foreach ($cot_extrafields[$db_structure] as $row) - 266

foreach ($extp_main as $pl) -274

have you same?

and config.php - debug mode turn  TRUE

than make cot_print($cot_extrafields);

page.functions.php is exactly the same.

than make cot_print($cot_extrafields);

Where exactly would that go?

12NächsteLetzte