Yii2 - strpos(): Empty needle in PhpMessageSource.php on line 111 - php

Please find below Stack Trace I pasted from apache error logs.
An Error occurred while handling another error:\nyii\\web\\HeadersAlreadySentException: Headers already sent. in /var/www/html/staging_v2/vendor/yiisoft/yii2/web/Response.php:373\nStack trace:\n#0
/var/www/html/staging_v2/vendor/yiisoft/yii2/web/Response.php(346): yii\\web\\Response->sendHeaders()\n#1
/var/www/html/staging_v2/vendor/yiisoft/yii2/web/ErrorHandler.php(136): yii\\web\\Response->send()\n#2
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/ErrorHandler.php(135): yii\\web\\ErrorHandler->renderException(Object(yii\\base\\ErrorException))\n#3
[internal function]: yii\\base\\ErrorHandler->handleException(Object(yii\\base\\ErrorException))\n#4
{main}\nPrevious exception:\nyii\\base\\ErrorException: strpos(): Empty needle in /var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/PhpMessageSource.php:111\nStack trace:\n#0
[internal function]: yii\\base\\ErrorHandler->handleError(2, 'strpos(): Empty...', '/var/www/html/s...', 111, Array)\n#1
/var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/PhpMessageSource.php(111): strpos('en-US', '')\n#2
/var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/PhpMessageSource.php(78): yii\\i18n\\PhpMessageSource->loadFallbackMessages('yii', '', NULL, '/var/www/html/s...')\n#3 /var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/MessageSource.php(107): yii\\i18n\\PhpMessageSource->loadMessages('yii', NULL)\n#4
/var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/MessageSource.php(87): yii\\i18n\\MessageSource->translateMessage('yii', '{attribute} can...', NULL)\n#5
/var/www/html/staging_v2/vendor/yiisoft/yii2/i18n/I18N.php(90): yii\\i18n\\MessageSource->translate('yii', '{attribute} can...', NULL)\n#6
/var/www/html/staging_v2/vendor/yiisoft/yii2/BaseYii.php(538): yii\\i18n\\I18N->translate('yii', '{attribute} can...', Array, NULL)\n#7
/var/www/html/staging_v2/vendor/yiisoft/yii2/validators/RequiredValidator.php(62): yii\\BaseYii::t('yii', '{attribute} can...')\n#8
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/BaseObject.php(109): yii\\validators\\RequiredValidator->init()\n#9
[internal function]: yii\\base\\BaseObject->__construct(Array)\n#10
/var/www/html/staging_v2/vendor/yiisoft/yii2/di/Container.php(420): ReflectionClass->newInstanceArgs(Array)\n#11
/var/www/html/staging_v2/vendor/yiisoft/yii2/di/Container.php(171): yii\\di\\Container->build('yii\\\\validators\\\\...', Array, Array)\n#12
/var/www/html/staging_v2/vendor/yiisoft/yii2/BaseYii.php(365): yii\\di\\Container->get('yii\\\\validators\\\\...', Array, Array)\n#13
/var/www/html/staging_v2/vendor/yiisoft/yii2/validators/Validator.php(231): yii\\BaseYii::createObject(Array)\n#14
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(469): yii\\validators\\Validator::createValidator('yii\\\\validators\\\\...', Object(frontend\\models\\ContactForm), Array, Array)\n#15 /var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(421): yii\\base\\Model->createValidators()\n#16
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(190): yii\\base\\Model->getValidators()\n#17
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(817): yii\\base\\Model->scenarios()\n#18
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(435): yii\\base\\Model->activeAttributes()\n#19
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Model.php(495): yii\\base\\Model->getActiveValidators('name')\n#20
/var/www/html/staging_v2/vendor/yiisoft/yii2/widgets/ActiveField.php(929): yii\\base\\Model->isAttributeRequired('name')\n#21
/var/www/html/staging_v2/vendor/yiisoft/yii2/widgets/ActiveField.php(405): yii\\widgets\\ActiveField->addAriaAttributes(Array)\n#22
/var/www/html/staging_v2/frontend/views/site/index.php(143): yii\\widgets\\ActiveField->textInput(Array)\n#23
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/View.php(348): require('/var/www/html/s...')\n#24
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/View.php(257): yii\\base\\View->renderPhpFile('/var/www/html/s...', Array)\n#25
/var/www/html/staging_v2/vendor/yiisoft/yii2/web/View.php(213): yii\\base\\View->renderFile('/var/www/html/s...', Array, Object(frontend\\controllers\\SiteController))\n#26 /var/www/html/staging_v2/vendor/yiisoft/yii2/web/Controller.php(53): yii\\web\\View->renderAjax('index', Array, Object(frontend\\controllers\\SiteController))\n#27 /var/www/html/staging_v2/frontend/controllers/SiteController.php(555): yii\\web\\Controller->renderAjax('index', Array)\n#28
[internal function]: frontend\\controllers\\SiteController->actionIndex()\n#29
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)\n#30
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Controller.php(181): yii\\base\\InlineAction->runWithParams(Array)\n#31
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Module.php(534): yii\\base\\Controller->runAction('index', Array)\n#32
/var/www/html/staging_v2/vendor/yiisoft/yii2/web/Application.php(104): yii\\base\\Module->runAction('site/index', Array)\n#33
/var/www/html/staging_v2/vendor/yiisoft/yii2/base/Application.php(392): yii\\web\\Application->handleRequest(Object(yii\\web\\Request))\n#34
/var/www/html/staging_v2/frontend/web/index.php(0): yii\\base\\Application->run()\n#35
You can find the issue here: https://staging-v2.storna.app
Admin Portal works https://staging-v2.storna.app/admin
API works too
Only landing pages have an issue.. it was working fine earlier.
What could be the issue?
There are only 2 issues in log. and 1 of which is warning and another is just a php7 notice. so I doubt it is due to this.

You seem to be using 2.0.40 version and this was already reported here. It seems the Problem only exists on PHP Version 7.1 - 7.4 as PHP 8.0 seems to pass successful with the reason being
Looks like the previous versions were resilient to language being set to null
You can either change your minimum-stability settings in the composer.json from stable to dev, and run composer update to update your yii framework to dev-master.
Or you can manually update those files only from this commit
I would use the second option as the first one will update all the packages too.

Related

Fatal Error WordPress Custom Post Type UI + WPML

After updating the wp-core, wpml plugin the other language link stopped working, after this, we contacted the support, and tried to roll back everything, and nothing helps
We noticed the conflict between two plugins WPML and Custom Post Type UI.
We started getting this Fatal Error:
Fatal error: Uncaught ValueError: Missing format specifier at end of string in /home/itdspl/domains/itds.tld/public_html/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php:416 Stack trace: #0 /home/itdspl/domains/itds.tld/public_html/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php(416): sprintf('Nigdy wi\xC4\x99cej %', 'Case Study') #1 /home/itdspl/domains/itds.tld/public_html/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php(320): cptui_register_single_post_type(Array) #2 /home/itdspl/domains/itds.tld/public_html/wp-includes/class-wp-hook.php(308): cptui_create_custom_post_types('') #3 /home/itdspl/domains/itds.tld/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #4 /home/itdspl/domains/itds.tld/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /home/itdspl/domains/itds.tld/public_html/wp-settings.php(617): do_action('init') #6 /home/itdspl/domains/itds.tld/public_html/wp-config.php(198): require_once('/home/itdspl/do...') #7 /home/itdspl/domains/itds.tld/public_html/wp-load.php(50): require_once('/home/itdspl/do...') #8 /home/itdspl/domains/itds.tld/public_html/wp-blog-header.php(13): require_once('/home/itdspl/do...') #9 /home/itdspl/domains/itds.tld/public_html/index.php(17): require('/home/itdspl/do...') #10 {main} thrown in /home/itdspl/domains/itds.tld/public_html/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php on line 416
How it can be resolved? From where should I start or what to do?
What is an idiot minus to this question??? The problem was not in the plugin code!
After days of searching for the issue and talking to support, I found an issue in String Translation for plugins.
We haven't translated the Custom Post Type UI plugin, and we found that from 400 lines of strings only one was translated and it caused the issue.
No %s Found >>>> Nie %
So this % at the end of the string was the main problem. Obviously that this sign "%" it's incorrect for the code to be in the end. I don't know how that happened since we didn't do this, but probably some issues after updating.
So, be aware, that it could be a really small thing and actually not obvious to check. We searched really deeply since we couldn't see any fatal errors even with a debug mode.

Podio PHP Issue

Hello Everyone and Podio Development team, I have some issues in podio since few days, I integrate podio in client project and project is in PHP Codeigniter, The podio API's were working before perfectly, but now there are some issues i am getting error The path '/item/basic' was not found.." Request URL: http://api.podio.com/item/basic
Although to verify code, I already checked old codes which was also integrated in podio and they are also not working now since few days. I checked podio website for Podio Items: Get item basic
https://developers.podio.com/doc/items/get-basic-item-61768
this is deprecated but no alternatives are provided and I am getting error regarding this.
When i comment code of podio and website works but when i uncomment code of podio and run it it shows error since few days, I have tried all steps and cross check in case code mistake there is no mistake as same code was working before, old codes also i checked which worked before not worked now. Kindly help me thank you.
Attaching screenshots
Fatal error: Uncaught PodioNotFoundError: "No matching operation could be found. The path '/item/basic' was not found.." Request URL: http://api.podio.com/item/basic Stack Trace: #0 /home/username/public_html/podio-php-4.3.0/lib/Podio.php(351): Podio::request('GET', '/item//basic', Array, Array) #1 /home/username/public_html/podio-php-4.3.0/models/PodioItem.php(120): Podio::get('/item//basic', Array) #2 /home/username/public_html/st_application/controllers/user.php(1459): PodioItem::get_basic(NULL) #3 /home/username/public_html/st_application/controllers/user.php(901): User->podioPropertyCreate(336, Array, Array, Array, Array, '3 Females, 1 Ma...', 'uploads/files/', Array, 'jahanzeb#gmail....') #4 [internal function]: User->add_property('add') #5 /home/username/public_html/st_system/core/CodeIgniter.php(360): call_user_func_array(Array, Array) #6 /home/username/public_html/index.php(202): require_once('/home
/username...') #7 {main} thrown in /home/username/public_html/podio-php-4.3.0/lib/Podio.php on line 324
This is the issue image:
You are not passing the item_id with the API call.
For PodioItem::get_basic API call, the item_id parameter (first parameter) is required one.
Also, please note that this get_basic operation is deprecated and will be removed soon.
Please use Podio Get Item API instead.

Magento white page at front and backend

After customizing some files last week, both the back end and front end of the site I’m developing for went blank. I have already searched the internet and tried out some possible solutions, but none of them works.
Somehow I can’t manage to show any error message. I already uncommented ini_set(’display_errors’, 1);, changed error_reporting(E_ALL | E_STRICT); into error_reporting(E_ALL); and I tried even more possible solutions.
I also edited the memory to 128M, changed some settings in php.ini, changed local.xml.sample to local.xml. Nothing seems to work.
I seriously have no idea how I can solve this, so that’s why I’m here. I hope someone can help me. If you need more information, please ask, I don’t really know what’s necessary to answer my question.
After adding the following lines to index.php I managed to get error messages:
error_reporting(E_ALL);
ini_set(’display_errors’, 1);
ini_set(‘memory_limit’, ’256M’);
The error I get is:
Cannot send headers; headers already sent in /home/cheapas/public_html/index.php, line 39
Trace:
#0 /home/cheapas/public_html/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/cheapas/public_html/app/code/core/Mage/Core/Model/App.php(1246): Zend_Controller_Response_Abstract->setHeader(’Content-Type’, ‘text/html; char...’)
#2 /home/cheapas/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(80): Mage_Core_Model_App->getResponse()
#3 /home/cheapas/public_html/app/code/core/Mage/Core/Model/Url/Rewrite.php(204): Mage_Core_Controller_Varien_Front->getResponse()
#4 /home/cheapas/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(166): Mage_Core_Model_Url_Rewrite->rewrite()
#5 /home/cheapas/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#6 /home/cheapas/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /home/cheapas/public_html/index.php(91): Mage::run(’’, ‘store’)
#8 {main}
Guess what, line 39 is: ini_set(‘memory_limit’, ’256M’);
When I delete this line I get a blank page again, so that doesn’t solve anything. Does anyone have an idea on solving this? Thanks!
As you may have understood, I actually can get error messages to show when I force an error by adding an unknown or uncomplete line to my index.php. Somehow there is a problem which doesn’t want to show up.

Keep on getting error on website using AnchorCMS

I’m attempting to use AnchorCMS. I keep on getting this message at the bottom of my page.
Uncaught Exception
Undefined offset: 6
Origin
on line 90
Trace
#0 [internal function]: System\Error::shutdown()
#1 {main}
I’ve already tried deleting and reloading all files.
I also have the same problem as you. I tried to edit in Anchor/config/error.php report => true to report => false, but I’ve got a server error. Then I deleted the value (true or false), left it blank, and it succeed.

Magento OnePage checkout Undefined Variable

A few weeks ago I had a server crash, and had no real backups so everything had to be recovered manually. One of those things was a Magento store. I've got all of the files and database restored, however now when I try to go through the checkout process to test I get errors.
I can either click to register when checking out, then when I click 'Continue' on the checkout page I get a 'Loading next step' message then some kind of AJAX error in the Chrome network inspector when trying to access the saveBilling page. The error is listed below:
Notice: Undefined variable: nameGroupAttribute in /var/www/vhosts/mysite.com/httpdocs/app/code/local/Amasty/Customerattr/Model/Rewrite/Checkout/Type/Onepage.php on line 41
#0 /var/www/vhosts/mysite.com/httpdocs/app/code/local/Amasty/Customerattr/Model/Rewrite/Checkout/Type/Onepage.php(41): mageCoreErrorHandler(8, 'Undefined varia...', '/var/www/vhosts...', 41, Array)
#1 /var/www/vhosts/mysite.com/httpdocs/app/code/core/Mage/Checkout/controllers/OnepageController.php(307): Amasty_Customerattr_Model_Rewrite_Checkout_Type_Onepage->saveBilling(Array, false)
#2 /var/www/vhosts/mysite.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Checkout_OnepageController->saveBillingAction()
#3 /var/www/vhosts/mysite.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveBilling')
#4 /var/www/vhosts/mysite.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /var/www/vhosts/mysite.com/httpdocs/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#6 /var/www/vhosts/mysite.com/httpdocs/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#7 /var/www/vhosts/mysite.com/httpdocs/index.php(85): Mage::run('', 'store')
#8 {main}
I've searched every possible combination of words that I can think of and have come up empty. This site was setup before I arrived at this company so I have no idea if anything was changed that shouldn't have been. All I know is the site was working before the server went down, and now this part doens't work.
Thanks for any help!

Categories