opensourcepos / opensourcepos

Open Source Point of Sale is a web based point of sale application written in PHP using CodeIgniter framework. It uses MySQL as the data back end and has a Bootstrap 3 based user interface.

Home Page:http://www.opensourcepos.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Disappearing Item Image

odiea opened this issue · comments

Bug Description?

Add Item pic to Item form. Save open then save Item form. Item pic disappears.

Steps to Reproduce?

Same as above

Expected Behavior?

Item pic should stay.

OpensourcePOS Version

development (unreleased)

Php version

Php 8.2

What browsers are you seeing the problem on?

Chrome

Server Operating System and version

Wamp Server

Database Management System and version

Mysql 8.2.0

Web Server and version

Wamp Server

System Information Report (optional)

System Information Report

Unmodified copy of OpensourcePOS

  • I agree this copy has not been modified

controller/Items line 685 I changed $item_data['pic_filename'] = !empty($upload_data['orig_name']) && $upload_data['raw_name']? $upload_data['raw_name'] . '.' . $upload_data['file_ext']: null
to.
if(!empty($upload_data['orig_name']))
{
if($upload_data['raw_name'])
{
$item_data['pic_filename'] = $upload_data['raw_name'];
}
}
And now the previous avatar is not removed.

There are a couple of issues with Item save right now. Namely Attributes are not saving consistently, locale is not being respected with floats and the issue you reported. They may be related or they may be independent errors. I'm working on getting barcodes working properly everywhere, then the locale issue with floats. If someone wants to work on this issue before then, great. Otherwise I will work on it when I finish those.