Questions tagged [notice]
293 questions
27
votes
3 answers
Notice: Trying to get property of non-object error
i am trying to get data from:
http://api.convoytrucking.net/api.php?api_key=public&show=player&player_name=Mick_Gibson
but if i want to get player_name variable with this code:
$js =…

Aleš Kalan
- 337
- 1
- 3
- 11
20
votes
4 answers
Is it alright to suppress/hide PHP notices?
I've suppressed notices for quite some time with no problems whatsoever but I am beginning to wonder if I'm doing the right thing. I can't seem to find any logical reason why I shouldn't just suppress them but some other people seem to think that…

animuson
- 53,861
- 28
- 137
- 147
17
votes
4 answers
Check if Variable exists and === true
I want to check if:
a field in the array isset
the field === true
Is it possible to check this with one if statement?
Checking if === would do the trick but a PHP notice is thrown. Do I really have to check if the field is set and then if it is…

Sebastian Sebald
- 16,130
- 5
- 62
- 66
12
votes
6 answers
How can I fix "Notice: Undefined variable" in PHP?
Code:
Function ShowDataPatient($idURL)
{
$query =" select * from cmu_list_insurance,cmu_home,cmu_patient where cmu_home.home_id = (select home_id from cmu_patient where patient_hn like '%$idURL%')
AND cmu_patient.patient_hn…

Beebrabie
- 141
- 1
- 1
- 6
8
votes
4 answers
Array 2 string conversion while using CURLOPT_POSTFIELDS
I have following code:
// $postfields = array();
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
My $postfields variable is an array of parameters. And i have a notice there is array to string conversion. It works tho.
I could use…

Grzegorz
- 3,538
- 4
- 29
- 47
7
votes
2 answers
How to prevent Symfony from quitting the whole program when getting a warning or notice
In Symfony, when we run a command, if there is any notice or warning, Symfony shows a big red message and quits the whole program.
I want an error to be emitted to the log, but I don't want the whole program to quit. Can anyone please tell me how to…

user3541554
- 137
- 1
- 6
6
votes
1 answer
Change wc_empty_cart_message function in WooCommerce 3.1
I've been trying to change my layout for the empty-cart message. I've removed the action, and try to replace it.
I'd like to change the htm structure output from:
to:

Onno V.
- 117
- 1
- 1
- 13
6
votes
3 answers
How can I pre-increment at an empty array index without throwing a notice?
I'd like to do this:
$matched_tags[$tag]++
As a simple way of keeping track of how many times a given $tag is found during a loop.
This appears to be throwing a NOTICE the first time any new $tag is encountered, because the index is undefined. PHP…

Tom Auger
- 19,421
- 22
- 81
- 104
5
votes
4 answers
php: "notice" warnings on different machine
i've set up all my php stuff on a new machine and i'm getting really lots of notices warnings.
my code is working properly without errors on my old machine.
eg. the following line (which should get a recordset value) will cause a notice:
$ID =…

Fuxi
- 7,611
- 25
- 93
- 139
5
votes
2 answers
How to write a test case using rspec for a notice message
In my application I have a topic controller and I need to write a test case for creating a new topic. when a new topic is created it will be redirected to the show page of the newly created topic and a notice will be displayed "Topic was created…

Praveen R
- 190
- 3
- 13
5
votes
3 answers
Do all Wordpress sites need a EU Cookie notice?
Does Wordpress in its default install need an EU cookie notice? I have a number of people who have very simple Wordpress sites and am not sure if even a simple Wordpress site installs cookies on a viewers computer?

barbeluk1
- 99
- 7
5
votes
2 answers
I18n for flash messages with parameters in Rails
How can I add parameters to my parametrized and internationalized error message? Say, in my controller there's:
flash[:error] = t(:error)[:my_error_message]
And in en.yml:
error:
my_error_message: "This is the problem XXX already."

valk
- 9,363
- 12
- 59
- 79
5
votes
2 answers
flash[:notice] not working when using AJAX in Rails
I've tried different variants of make flash[:notice] working without reload.
Stackoverflow gave me this - How do you handle Rail's flash with Ajax requests?, but I can't find solution, that worked for me.
For example, added to my controller:
def…

Denys Medynskyi
- 2,353
- 8
- 39
- 70
4
votes
2 answers
Is there a way to have Behat NOT fail on PHP Notice errors?
I understand that it is a best practice to have all variables defined and to check for array indexes before evaluating. However, I'm trying to run some tests on new functionalities developed on top of some legacy code which has not been coded this…

JuanXarg
- 428
- 2
- 11
4
votes
2 answers
Display a custom message based on customer shipping zone in Woocommerce
In woocommerce, I need to display custom message on cart or checkout page, based on shipping zone, like "you'll be charged 10% more for this zip code".
My workaround is about customizing that kind of default message :
add_filter(…

Camille S.
- 61
- 1
- 6