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.
http://www.opensourcepos.org
Other
3.48k stars 2.19k forks source link

[Bug]: Gift card search appears broken #4030

Closed odiea closed 2 months ago

odiea commented 4 months ago

Bug Description?

Enter a gift card as payment in Sales. Card 101 only displays card 1.

Steps to Reproduce?

Enter a gift card as payment in Sales. Card 101 only displays card 1.

Expected Behavior?

Card search should display card 101 not 1.

OpensourcePOS Version

development (unreleased)

Php version

Php 8.4

What browsers are you seeing the problem on?

Chrome

Server Operating System and version

wamp Server

Database Management System and version

mysql

Web Server and version

Wamp Server

System Information Report (optional)

No error log displays. In network search does show it has issues.

Unmodified copy of OpensourcePOS

objecttothis commented 3 months ago

@odiea I can't replicate this on the development branch I'm working on now. I wonder if this is specific to MySQL 8.4. If it is, then my vote is to just get this release out with MySQL <= 8.3 support and then work on MySQL 8.4 support in a different release. Any chance you can test it in 8.3 or lower to see if the error persists?

odiea commented 3 months ago

Sorry I was testing this in 8.2 or 8.3. Don't know where I got 8.4.

objecttothis commented 3 months ago

OK, it must have been introduced recently because I just changed to a new branch which has been rebased on the master and I can now replicate it. I'll have to investigate it more after fixing the attributes problems.

odiea commented 3 months ago

In Controller/Giftcards I changes line 61 from Post to Get and it started working better.


public function getSuggest(): void
    {
        $search = $this->request->getGet('term');
        $suggestions = $this->giftcard->get_search_suggestions($search, true);

        echo json_encode($suggestions);
    }
jekkos commented 2 months ago

Fix is in master now.

objecttothis commented 2 months ago

odiea please tell me if you get this. We are trying to troubleshoot why @WebShells isn't getting notifications to his email so I changed your repo permissions to the same as his (temporarily). I want to see if you stop getting notifications.

odiea commented 2 months ago

Yes I did get this notification.

jekkos commented 2 months ago

Tested in master, works so will close.