Comments (25)
Why is this even in there. It is not in the original barcode sheet? It works without it.
lang="request->getLocale() ?>
from opensourcepos.
Does the language line properly generate without it? If so, then we can just remove it.
from opensourcepos.
If you are concerned about the lang line I replaced this with the one from the header. This does not show an error. It appears the only lang file in this is on the title which I have never seen shown. Yes it works just fine without it.
use Config\Services;
$request = Services::request();
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?= $request->getLocale() ?>">
from opensourcepos.
If the lang line in the title tag works OK without lang="<?= $request->getLocale() ?>
then I agree that we should remove it from the code. It may have been added in to appease the IDE linters.
from opensourcepos.
I've pushed several changes which fix some problems, but I believe there are more problems to resolve. For example the config for "Input Formats" is wrong.
from opensourcepos.
Here is the code I used. Hope it helps
<div class="form-group form-group-sm">
<?php echo form_label(lang('Config.barcode_formats'), 'barcode_formats', ['class' => 'control-label col-xs-2']) ?>
<div class='col-xs-4'>
<?php
$barcode_formats = json_decode(config('OSPOS')->settings['barcode_formats']);
echo form_dropdown ([
'name' => 'barcode_formats[]',
'id' => 'barcode_formats',
'options' => !empty($barcode_formats) ? esc(array_combine($barcode_formats, $barcode_formats), 'attr') : [],
'multiple' => 'multiple',
'data-role' => 'tagsinput']) ?>
</div>
</div>```
from opensourcepos.
Here is the code I used. Hope it helps
<div class="form-group form-group-sm"> <?php echo form_label(lang('Config.barcode_formats'), 'barcode_formats', ['class' => 'control-label col-xs-2']) ?> <div class='col-xs-4'> <?php $barcode_formats = json_decode(config('OSPOS')->settings['barcode_formats']); echo form_dropdown ([ 'name' => 'barcode_formats[]', 'id' => 'barcode_formats', 'options' => !empty($barcode_formats) ? esc(array_combine($barcode_formats, $barcode_formats), 'attr') : [], 'multiple' => 'multiple', 'data-role' => 'tagsinput']) ?> </div> </div>```
Epic. Thanks. I'm hoping that's what is causing the null reference exception when the line 2 is the item id and the barcode type is EAN-13.
from opensourcepos.
@odiea your code change resolves the issue with the configuration. Thank you for posting that. Our bug with getting an undefined array key ""
error when EAN-13 is the barcode type, barcode is an ISBN-13 number, barcode content is set to Item Id/Name and Barcode Layout set to Item Name/Barcode/Retail Price is still present.
When I check "Generate if Empty" the problem goes away. @odiea do you get the same behavior with the settings I listed?
from opensourcepos.
What's a good ean-13 or isbn-13 number to try. No i have not tested this yet.
from opensourcepos.
Is this what you are looking for? No errors show not even in error log.
This is if I change to barcode instead of item_id
from opensourcepos.
I'm using 9780230766518 for the value of item_number (the barcode) on an item that isn't generating but throwing the exception. The thing I find interesting is that the barcode content is set to Item Id/Name, so it shouldn't matter what the Barcode value is.
from opensourcepos.
Here's the exact error and stack trace
Caught exception: Undefined array key ""
Stack trace:
#0 \app\Libraries\Barcodes\Ean13.php(277): CodeIgniter\Debug\Exceptions->errorHandler(2, 'Undefined array...', 'C:\Users\objec\...', 277)
#1 \app\Libraries\Barcode_lib.php(157): App\Libraries\Barcodes\Ean13->draw()
#2 \app\Libraries\Barcode_lib.php(214): App\Libraries\Barcode_lib->generate_barcode(Array, Array)
#3 \app\Views\barcodes\barcode_sheet.php(34): App\Libraries\Barcode_lib->display_barcode(Array, Array)
#4 \vendor\codeigniter4\framework\system\View\View.php(228): include('C:\Users\objec\...')
#5 \vendor\codeigniter4\framework\system\View\View.php(231): CodeIgniter\View\View->CodeIgniter\View{closure}()
#6 \vendor\codeigniter4\framework\system\Common.php(1178): CodeIgniter\View\View->render('barcodes/barcod...', Array, true)
#7 \app\Controllers\Items.php(521): view('barcodes/barcod...', Array)
#8 \vendor\codeigniter4\framework\system\CodeIgniter.php(941): App\Controllers\Items->getGenerateBarcodes(Array)
#9 \vendor\codeigniter4\framework\system\CodeIgniter.php(502): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Items))
#10 \vendor\codeigniter4\framework\system\CodeIgniter.php(361): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#11 \public\index.php(79): CodeIgniter\CodeIgniter->run()
#12 {main}
from opensourcepos.
Yes I also have that issue with this barcode
ISBN 9780230766518 EDIT PRODUCT
The $100 Startup: Fire Your Boss, Do What You Love and Work Better to Live More
(Write a Review)
Barcode Formats: ISBN-10 023076651X, ISBN-13 9780230766518
Category: Media > Books
Author: Guillebeau, Chris
from opensourcepos.
It doesn't show the issue when I change it to EAN 8
from opensourcepos.
The place that it's dying is in this for loop
for ($idx = 1; $idx < 7; ++$idx)
{
$value = substr($this->data, $idx, 1);
if(isset($this->_codingmap[$value][$set_array[$idx - 1]]))
{
foreach($this->_codingmap[$value][$set_array[$idx - 1]] as $bar)
{
if($bar)
{
imagefilledrectangle(
$this->img,
$xpos,
0,
$xpos + $pxPerBar - 1,
$this->y,
$black
);
}
$xpos += $pxPerBar;
}
}
else
{
throw new \Exception("Invalid index in _codingmap array. Value: $value, Set: {$set_array[$idx - 1]}");
}
}
It's trying to access an array element 5 but the item id 13228 only has 0-4
from opensourcepos.
The frustrating thing is that this is working in 3.3.9.
from opensourcepos.
I understand your pain. Sendmail also does not work depending on the php version or Apache version.
from opensourcepos.
I understand your pain. Sendmail also does not work depending on the php version or Apache version.
That reminds me. The mixed
type hint for function parameters wasn't introduced until PHP 8.0 so we need to find any instances of it in the code and remove them because they will break PHP 7.4 user's applications.
from opensourcepos.
CRITICAL - 2024-02-27 15:46:47 --> Argument 1 passed to App\Libraries\Barcodes\Ean13::setData() must be an instance of App\Libraries\Barcodes\mixed, string given, called in C:\newwamp\www\ospos\app\Libraries\Barcode_lib.php on line 80
in APPPATH\Libraries\Barcodes\Ean13.php on line 125.
1 APPPATH\Libraries\Barcode_lib.php(80): App\Libraries\Barcodes\Ean13->setData('2')
2 APPPATH\Libraries\Barcode_lib.php(149): App\Libraries\Barcode_lib::barcode_instance([...], [...])
3 APPPATH\Libraries\Barcode_lib.php(205): App\Libraries\Barcode_lib->generate_barcode([...], [...])
4 APPPATH\Views\barcodes\barcode_sheet.php(34): App\Libraries\Barcode_lib->display_barcode([...], [...])
5 SYSTEMPATH\View\View.php(228): include('C:\newwamp\www\ospos\app\Views\barcodes\barcode_sheet.php')
6 SYSTEMPATH\View\View.php(231): CodeIgniter\View\View->CodeIgniter\View{closure}()
7 SYSTEMPATH\Common.php(1190): CodeIgniter\View\View->render('barcodes/barcode_sheet', [], true)
8 APPPATH\Controllers\Items.php(520): view('barcodes/barcode_sheet', [...])
9 SYSTEMPATH\CodeIgniter.php(942): App\Controllers\Items->getGenerateBarcodes([...])
10 SYSTEMPATH\CodeIgniter.php(502): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Items))
11 SYSTEMPATH\CodeIgniter.php(361): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 FCPATH\index.php(79): CodeIgniter\CodeIgniter->run()
from opensourcepos.
Exactly. Just take the mixed type hint out and it will work. We need to do a code search for other places with mixed in there.
from opensourcepos.
I changed the location of the $value and it is not givng me the error now. But does it give a correct ean13 for you
$value = substr($this->data, $idx, 1);
for ($idx = 1; $idx < 7; ++$idx)
{
//$value = substr($this->data, $idx, 1);
foreach ($this->_codingmap[$value][$set_array[$idx - 1]] as $bar)
{
if ($bar)
{
imagefilledrectangle(
$this->img,
$xpos,
0,
$xpos + $pxPerBar - 1,
$this->y,
$black
);
}
$xpos += $pxPerBar;
}
}
from opensourcepos.
Related Issues (20)
- CI4: Item CSV Import Broken HOT 1
- Configure projects for the opensourcepos team
- Move chat from Matrix (formerly gitter) HOT 2
- CI4 Item attributes not working properly
- Request to remove the showing of the word 'Category' or 'Item name' above and below the Barcode HOT 3
- Http 500 error when installing OSPOS on a web hosting HOT 1
- Harmonize configuration for docker/host setup HOT 3
- npm audit reporting two critical errors HOT 5
- CI3 version and PHP 8+ major issue. HOT 6
- Tarballs are not generated by gulp
- CI4 Testing with different versions HOT 1
- Adding Serial Number prevents us from chaning the quantity of that item HOT 1
- Fix reference to chartist-tooltip plugin
- Windows 11 HTTP ERROR 500 HOT 4
- Customers Table Comments with newline HOT 1
- Feature: Rename Company Logo on upload and housekeeping of company_logo files HOT 2
- delete button for suspended sales direct from menu HOT 6
- Request for a new feature: Off-line capability of OSPOS HOT 6
- Nuestra pagina web es inestable y se cae constantemente HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opensourcepos.