Hi

You get this message only if you create an auction post .

Notice :Undefined index: display_price in uc_taxes_entity_view_alter() (line 114  xxxxx\modules\ubercart\uc_taxes\uc_taxes.module).
Notice :Undefined index: #value in uc_taxes_entity_view_alter() (line  114 in xxxxx\modules\ubercart\uc_taxes\uc_taxes.module).

If you delete the auction post the error disappears.

Any help !!

Comments

Abo-1’s picture

Assigned: Abo-1 » Unassigned
longwave’s picture

What do you mean by "auction post"? If you are using uc_auction or a similar module, then this issue probably needs to be fixed in that module.

Abo-1’s picture

nope ,
if you create a product "as sell not auction" it's ok. no errors
but if you create a product as "Auction" you got that error.
So.... I think the problem in uc_auction

tr’s picture

Project: Ubercart » Ubercart Auction
Version: 7.x-3.5 » 7.x-1.x-dev
Component: Taxes » Code
wildlife’s picture

I'm having the same problem trying to set up an auction product.

Notice: Undefined index: display_price in uc_taxes_entity_view_alter() (line 114 of xxxxx/modules/ubercart/uc_taxes/uc_taxes.module).
Notice: Undefined index: #value in uc_taxes_entity_view_alter() (line 114 of xxxxx/modules/ubercart/uc_taxes/uc_taxes.module).

kim51’s picture

I'm having the same problem.
I investigated the cause of the Notice.

This is occurred when "auction settings(on the each product edit) -> This is an auctioned product." is checked.

So I printed $build by using dsm like below.

function uc_taxes_entity_view_alter(&$build, $entity_type) {
dsm($build);

If "This is an auctioned product."(in short auction option) is checked ,
I couldn't find 'display_price' and could find uc_auction.
If the auction option is not checked ,
I could find 'display_price' and couldn't find uc_auction.

So I changed code to
when only the auction option is not checked ,
"if" phrase is executed.

It's like below.
before:if (uc_product_is_product($build['#node'])) {
after:if (uc_product_is_product($build['#node']) and empty($build['uc_auction'])) {
...

As doing like above,
the "Notice :Undefined index: display_price" is disappeared.

I know it's not right way.

but I don't know what is $build['display_price']['#value'],
where , how and when it is used.

loziju’s picture

Status: Active » Needs review
StatusFileSize
new767 bytes

I'm not familiar with the whole ubercart architecture. But I need to fix this error. So either I fix it in the main ubercart or in uc_auction. As uc_auction is a smaller module, thus changing few lines of codes in uc_auction is not as critical as changing few lines of codes in main ubercart modules. Furthermore, the suspect code in uc_auction is concentrated in few lines.

Here's the patch. Instead of unsetting the 3 array elements, use #access property to hide the 3 elements for auctionable products. With this, the original array elements required by ubercart are not disturbed.