Friendlier error message

Permalink Browser Info Environment
Instead of a message like "Invalid Email Address: " and nothing else, I'd like to give the user a prompt to use the back button on their browser. I expected to see the error warning language in the view.php file for monkey-block, but did not. Can you tell me where that lives so I can edit it?

Type: Discussion
Status: Resolved
bjalexander
View Replies:
JoeHiveCreative replied on at Permalink Reply
JoeHiveCreative
The error message is actually generated by the MailChimp API call ...

The block controller loads the MCAPI model (models/monkeysee.php) and then calls listSubscribe() with the values that the user has input ... if the errorCode is non-zero after that call then it grabs errorMessage from the MCAPI object and sends that back ...

The only hardcoded error messages that could be changed locally are contained in callServer() at the end of the model file ...

The easiest way to do what you are asking would be to add the following code to blocks/monkey_block/controller.php:54
if ($api->errorCode){
    $error= $api->errorMessage;
    if (strpos($error,'Invalid Email Address') !== false) {
        // manipulate the error string here
    }
    $this->view($thanks=$error);
}else{

concrete5 Environment Information

# concrete5 Version
5.6.3.2

# concrete5 Packages
Designer Content (3.1.1), Dojo Page Filter Pro (2.3), Mail Monkey (2.1.2), Pro Blog (12.4.4), RSS Feed Creator (1.24), Simple Blog (4.2.1), Socializer (5.6.0.0.6.1.5), Structura Theme (1.1.1), Whale Nivo Image Slider (1.2).

# concrete5 Overrides
blocks/case_study_summary, blocks/case_study_overview, blocks/case_study_block, blocks/content, blocks/templates, blocks/problog_list, blocks/autonav, languages/el_GR, languages/nb_NO, languages/es_PE, languages/sv_SE, languages/zh_TW, languages/de_DE, languages/he_IL, languages/da_DK, languages/vi_VN, languages/fa_IR, languages/fr_FR, languages/zh_CN, languages/it_IT, languages/sl_SI, languages/ru_RU, languages/ro_RO, languages/ja_JP, languages/es_MX, languages/fi_FI, languages/pt_PT, languages/cs_CZ, languages/tr_TR, languages/es_ES, languages/es_AR, languages/ar, languages/nl_NL, languages/sk_SK, themes/MTG_Site, themes/MTG_Site.zip

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
5.4.34

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, json, ldap, libxml, mbstring, mcrypt, mhash, mysql, mysqli, odbc, openssl, pcntl, pcre, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, recode, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Guard Loader, zip, zlib.

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 50M
sql.safe_mode - Off
upload_max_filesize - 50M
ldap.max_links - Unlimited
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:34.0) Gecko/20100101 Firefox/34.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.