e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
322 stars 214 forks source link

COPPA has to be enabled if Extended User Fields are set to display on Signup Page #4991

Closed martyshep closed 1 year ago

martyshep commented 1 year ago

Bug Description

If Extended User Fields are activated and set to display on Signup Page, then COPPA has to be enabled otherwise no Signup Page is displayed.

How to Reproduce

Steps to reproduce the behaviour:

  1. Activate an Extended User Field such as 'Country'
  2. Manage that Extended User Field and set it to display on Signup Page
  3. Use another browser and go to your site and select Signup
  4. No Signup Page is shown

Workaround

Enable use of COPPA, Signup Page now appears after selecting Yes to COPPA.

Server Information

PHP Operating System

Linux localhost 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64

PHP Version

PHP Version 7.2.34

PHP Modules

bcmath bz2 calendar cgi-fcgi Core ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv imagick imap intl ionCube Loader json libxml mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix Reflection session SimpleXML soap sockets SPL sqlite3 standard tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zip zlib

Client Information

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

Additional Information

Add any other context about the problem here.

Deltik commented 1 year ago

The blank page is caused by a fatal error logged in the PHP error log:

[Sun Apr 16 05:17:36.192621 2023] [proxy_fcgi:error] [pid 37655:tid 140311615502080] [client 10.64.229.1:53196] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /var/www/html/e107/e107_core/shortcodes/batch/signup_shortcodes.php:548
Stack trace:
#0 /var/www/html/e107/e107_handlers/shortcode_handler.php(1154): signup_shortcodes->sc_signup_extended_user_fields()
#1 [internal function]: e_parse_shortcode->doCode()
#2 /var/www/html/e107/e107_handlers/shortcode_handler.php(1020): preg_replace_callback()
#3 /var/www/html/e107/e107_handlers/e_parse_class.php(848): e_parse_shortcode->parseCodes()
#4 /var/www/html/e107/signup.php(658): e_parse->parseTemplate()
#5 {main}
  thrown in /var/www/html/e107/e107_core/shortcodes/batch/signup_shortcodes.php on line 548', referer: http://10.64.229.195/e107/
Deltik commented 1 year ago

https://github.com/e107inc/e107/pull/4993 should fix this bug.

martyshep commented 1 year ago

Thank you Deltik, #4993 does indeed fix it for me. No COPPA required now.