Coder Social home page Coder Social logo

part-db / part-db-server Goto Github PK

View Code? Open in Web Editor NEW
797.0 28.0 89.0 59.59 MB

Part-DB is an Open source inventory management system for your electronic components

Home Page: https://docs.part-db.de/

License: GNU Affero General Public License v3.0

PHP 82.07% CSS 2.00% JavaScript 6.59% Dockerfile 0.13% Shell 0.12% Twig 9.09% Procfile 0.01%
part-db symfony electronics php mysql database symfony-application symfony5 inventory inventory-management

part-db-server's Introduction

Scrutinizer Code Quality PHPUnit Tests Static analysis codecov GitHub License PHP Version

Docker Pulls Docker Build Status Crowdin

Documentation | Demo | Docker Image

Part-DB

Part-DB is an Open-Source inventory management system for your electronic components. It is installed on a web server and so can be accessed with any browser without the need to install additional software.

The version in this repository is a complete rewrite of the legacy Part-DB (Version < 1.0) based on a modern framework and is the recommended version to use.

If you find a bug, please open an Issue on GitHub, so it can be fixed for everybody.

Demo

If you want to test Part-DB without installing it, you can use this Heroku instance. (Or this link for the German Version).

You can log in with username: user and password: user.

Every change to the master branch gets automatically deployed, so it represents the current development progress and is may not completely stable. Please mind, that the free Heroku instance is used, so it can take some time when loading the page for the first time.

Features

  • Inventory management of your electronic parts. Each part can be assigned to a category, footprint, manufacturer, and multiple store locations and price information. Parts can be grouped using tags. You can associate various files like datasheets or pictures with the parts.
  • Multi-language support (currently German, English, Russian, Japanese, French, Czech, Danish, and Chinese)
  • Barcodes/Labels generator for parts and storage locations, scan barcodes via webcam using the builtin barcode scanner
  • User system with groups and detailed (fine granular) permissions. Two-factor authentication is supported (Google Authenticator and Webauthn/U2F keys) and can be enforced for groups. Password reset via email can be set up.
  • Optional support for single sign-on (SSO) via SAML (using an intermediate service like Keycloak you can connect Part-DB to an existing LDAP or Active Directory server)
  • Import/Export system for parts and data structure. BOM import for projects from KiCAD is supported.
  • Project management: Create projects and assign parts to the bill of material (BOM), to show how often you could build this project and directly withdraw all components needed from DB
  • Event log: Track what changes happen to your inventory, track which user does what. Revert your parts to older versions.
  • Responsive design: You can use Part-DB on your PC, your tablet, and your smartphone using the same interface.
  • MySQL, SQLite and PostgreSQL are supported as database backends
  • Support for rich text descriptions and comments in parts
  • Support for multiple currencies and automatic update of exchange rates supported
  • Powerful search and filter function, including parametric search (search for parts according to some specifications)
  • Automatic thumbnail generation for pictures
  • Use cloud providers (like Octopart, Digikey, Farnell, LCSC or TME) to automatically get part information, datasheets, and prices for parts
  • API to access Part-DB from other applications/scripts
  • Integration with KiCad: Use Part-DB as the central datasource for your KiCad and see available parts from Part-DB directly inside KiCad.

With these features, Part-DB is useful to hobbyists, who want to keep track of their private electronic parts inventory, or maker spaces, where many users should have (controlled) access to the shared inventory.

Part-DB is also used by small companies and universities for managing their inventory.

Requirements

  • A web server (like Apache2 or nginx) that is capable of running Symfony 6, this includes a minimum PHP version of PHP 8.1
  • A MySQL (at least 5.7) /MariaDB (at least 10.4) database server, or PostgreSQL 10+ if you do not want to use SQLite.
  • Shell access to your server is highly recommended!
  • For building the client-side assets yarn and nodejs (>= 18.0) is needed.

Installation

If you want to upgrade your legacy (< 1.0.0) version of Part-DB to this version, please read this first.

Hint: A docker image is available under jbtronics/part-db1. How to set up Part-DB via docker is described here.

Below you find a very rough outline of the installation process, see here for a detailed guide on how to install Part-DB.

  1. Copy or clone this repository into a folder on your server.
  2. Configure your webserver to serve from the public/ folder. See here for additional information.
  3. Copy the global config file cp .env .env.local and edit .env.local:
    • Change the line APP_ENV=dev to APP_ENV=prod
    • If you do not want to use SQLite, change the value of DATABASE_URL= to your needs ( see here) for the format. In bigger instances with concurrent accesses, MySQL is more performant. This can not be changed easily later, so choose wisely.
  4. Install composer dependencies and generate autoload files: composer install -o --no-dev
  5. Install client side dependencies and build it: yarn install and yarn build
  6. Optional (speeds up first load): Warmup cache: php bin/console cache:warmup
  7. Upgrade database to new scheme (or create it, when it was empty): php bin/console doctrine:migrations:migrate and follow the instructions given. During the process the password for the admin is user is shown. Copy it. Caution: These steps tamper with your database and could potentially destroy it. So make sure to make a backup of your database.
  8. You can configure Part-DB via config/parameters.yaml. You should check if settings match your expectations after you installed/upgraded Part-DB. Check if partdb.default_currency matches your mainly used currency (this can not be changed after creating price information). Run php bin/console cache:clear when you change something.
  9. Access Part-DB in your browser (under the URL you put it) and log in with user admin. Password is the one outputted during DB setup. If you can not remember the password, set a new one with php bin/console app:set-password admin. You can create new users with the admin user and start using Part-DB.

When you want to upgrade to a newer version, then just copy the new files into the folder and repeat the steps 4. to 7.

Normally a random password is generated when the admin user is created during initial database creation, however, you can set the initial admin password, by setting the INITIAL_ADMIN_PW env var.

You can configure Part-DB to your needs by changing environment variables in the .env.local file. See here for more information.

Reverse proxy

If you are using a reverse proxy, you have to ensure that the proxies set the X-Forwarded-* headers correctly, or you will get HTTP/HTTPS mixup and wrong hostnames. If the reverse proxy is on a different server (or it cannot access Part-DB via localhost) you have to set the TRUSTED_PROXIES env variable to match your reverse proxy's IP address (or IP block). You can do this in your .env.local or (when using docker) in your docker-compose.yml file.

Donate for development

If you want to donate to the Part-DB developer, see the sponsor button in the top bar (next to the repo name). There you will find various methods to support development on a monthly or a one-time base.

Built with

Authors

  • Jan Böhmer - Initial work - GitHub

See also the list of contributors who participated in this project.

Based on the original Part-DB by Christoph Lechner and K. Jacobs

License

Part-DB is licensed under the GNU Affero General Public License v3.0 (or at your opinion any later). This mostly means that you can use Part-DB for whatever you want (even use it commercially) as long as you publish the source code for every change you make under the AGPL, too.

See LICENSE for more information.

part-db-server's People

Contributors

ajw287 avatar au-ee avatar codeman256 avatar coeka avatar d-buchmann avatar dependabot-preview[bot] avatar dependabot[bot] avatar frank-f avatar hkleen avatar hmatuschek avatar japm48 avatar jbtronics avatar jsuelwald avatar mdiepart avatar meganukebmp avatar misaz avatar pyromane avatar raptorde avatar sapuseven avatar sascha988 avatar suuppl avatar tacman avatar tbornon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

part-db-server's Issues

General State of Development

I see you are working on the project right now. First big thanks for all the effort you are putting into that project!.

I would like to ask if you could share a quick overview of what features are tested and which are missing or not working. And in how far the databases are compatible with the older version.

We start a new project space and are thinking about using the new version...

console cache:warmup silently fails when no permission to write to var/cache

php bin/console cache:warmup script mentioned in installation notes states succesfull warming, but logs errors. Trying to open app in browser after that gives 500 error code.

2020-01-31 17:17:44] cache.WARNING: Failed to save key "version" of type Version\Version: file_put_contents(/home/builder/partdb/var/cache/prod/pools/OqCSUa9WTD/5e346138abd444.61684305): failed to open stream: Permission denied {"key":"version","exception":"[object] (ErrorException(code: 0): file_put_contents(/home/builder/partdb/var/cache/prod/pools/OqCSUa9WTD/5e346138abd444.61684305): failed to open stream: Permission denied at /home/builder/partdb/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:98)"} []
[2020-01-31 17:17:44] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} []
[2020-01-31 17:17:45] request.INFO: Matched route "user_settings". {"route":"user_settings","route_parameters":{"_route":"user_settings","_controller":"App\\Controller\\UserSettingsController::userSettings","_locale":"en"},"request_uri":"http://11.0.0.102:81/en/user/settings","method":"GET"} []
[2020-01-31 17:17:45] security.DEBUG: Read existing security token from the session. {"key":"_security_main","token_class":"Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken"} []
[2020-01-31 17:17:45] security.DEBUG: User was reloaded from a user provider. {"provider":"Symfony\\Bridge\\Doctrine\\Security\\User\\EntityUserProvider","username":"admin"} []
[2020-01-31 17:17:45] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Unable to write to the "/home/builder/partdb/var/cache/prod" directory." at /home/builder/partdb/vendor/symfony/filesystem/Filesystem.php line 683 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Unable to write to the \"/home/builder/partdb/var/cache/prod\" directory. at /home/builder/partdb/vendor/symfony/filesystem/Filesystem.php:683)"} []
[2020-01-31 17:17:45] cache.WARNING: Failed to save key "%5BSymfony%5CComponent%5CHttpKernel%5CController%5CErrorController%5D%5B1%5D" of type array: file_put_contents(/home/builder/partdb/var/cache/prod/pools/yt4qg5foDg/5e3461392b71d7.69584045): failed to open stream: Permission denied {"key":"%5BSymfony%5CComponent%5CHttpKernel%5CController%5CErrorController%5D%5B1%5D","exception":"[object] (ErrorException(code: 0): file_put_contents(/home/builder/partdb/var/cache/prod/pools/yt4qg5foDg/5e3461392b71d7.69584045): failed to open stream: Permission denied at /home/builder/partdb/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:98)"} []
[2020-01-31 17:17:45] cache.WARNING: Failed to save key "%5BSymfony%5CComponent%5CHttpKernel%5CController%5CErrorController%23__invoke%5D%5B1%5D" of type array: file_put_contents(/home/builder/partdb/var/cache/prod/pools/yt4qg5foDg/5e3461392b71d7.69584045): failed to open stream: Permission denied {"key":"%5BSymfony%5CComponent%5CHttpKernel%5CController%5CErrorController%23__invoke%5D%5B1%5D","exception":"[object] (ErrorException(code: 0): file_put_contents(/home/builder/partdb/var/cache/prod/pools/yt4qg5foDg/5e3461392b71d7.69584045): failed to open stream: Permission denied at /home/builder/partdb/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:98)"} []
[2020-01-31 17:17:45] cache.WARNING: Failed to save key "version" of type Version\Version: file_put_contents(/home/builder/partdb/var/cache/prod/pools/OqCSUa9WTD/5e3461392bfe08.42085575): failed to open stream: Permission denied {"key":"version","exception":"[object] (ErrorException(code: 0): file_put_contents(/home/builder/partdb/var/cache/prod/pools/OqCSUa9WTD/5e3461392bfe08.42085575): failed to open stream: Permission denied at /home/builder/partdb/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:98)"} []
[2020-01-31 17:17:45] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} []

Dates on labels seem to be in UTC

Describe the bug
When printing a label e.g. for a location and adding the ​[[CREATION_DATE]]​ placeholder, the shown time seems to be in UTC independent of the date.timezone setting in the php.ini.
The creation date in the location "Info" tab in the location edit menu seems to be right (https://part-db.herokuapp.com/en/store_location/385/edit#info)
Not sure if this behavior is expected or wanted?

Expected behavior
Maybe show the same time as on other info screens?

Screenshots
image

image

Server Side
Current version at https://part-db.herokuapp.com/en/

db schema creation failure

Greetings.
Trying to make clean install of this rewrite of part-db.
Execution of php bin/console doctrine:migrations:migrate breaks with following:

In AbstractMySQLDriver.php line 79:
                                                                             
  An exception occurred while executing 'UPDATE `groups`                     
          SET perms_parts_category = 9, perms_parts_minamount = 9, perms_pa  
  rts_lots = 169, perms_parts_tags= 9,                                       
              perms_parts_unit = 9, perms_parts_mass = 9, perms_parts_statu  
  s = 9, perms_parts_mpn = 9,                                                
              perms_currencies = 9897, perms_measurement_units = 9897, perm  
  s_parts_attachements = 681,                                                
              perms_parts_orderdetails = 681, perms_parts_prices = 681       
          WHERE id = 2 AND name = "readonly";                                
                                                                             
          UPDATE `groups`                                                    
          SET perms_parts_category = 5, perms_parts_minamount = 5, perms_pa  
  rts_lots = 85, perms_parts_tags= 5,                                        
              perms_parts_unit = 5, perms_parts_mass = 5, perms_parts_statu  
  s = 5, perms_parts_mpn = 5,                                                
              perms_currencies = 5461, perms_measurement_units = 5461, perm  
  s_parts_attachements = 341,                                                
              perms_parts_orderdetails = 341, perms_parts_prices = 341       
          WHERE (id = 1 AND name = "admins")                                 
              OR (id = 3 AND name = "users");                                
          ':                                                                 
                                                                             
  You have an error in your SQL syntax; check the manual that corresponds t  
  o your MariaDB server version for the right syntax to use near 'UPDATE `g  
  roups`                                                                     
          SET perms_parts_category = 5, perms_parts_minamount = 5,' at line  
   8                                                                         
                                                                             

In MysqliStatement.php line 82:
                                                                             
  You have an error in your SQL syntax; check the manual that corresponds t  
  o your MariaDB server version for the right syntax to use near 'UPDATE `g  
  roups`                                                                     
          SET perms_parts_category = 5, perms_parts_minamount = 5,' at line  
   8                                                                                                                                                                                                                                                          

I'm on Gentoo with php 7.3.11 and mariadb 10.2.29.

Error 500 when deleting devices

Describe the bug
I created a device and wanted it delete again. But got the following error message:
[2020-05-17T22:21:17.095011+02:00] request.CRITICAL: Uncaught PHP Exception BadMethodCallException: "Undefined method 'getPartsCount'. The method name must start with either findBy, findOneBy or countBy!" at /var/www/partdb/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 235 {"exception":"[object] (BadMethodCallException(code: 0): Undefined method 'getPartsCount'. The method name must start with either findBy, findOneBy or countBy! at /var/www/partdb/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:235)"} []

To Reproduce
Steps to reproduce the behavior:

  1. Create a device
  2. Click on 'Delete' of the new created device
  3. See error

Server Side

  • Part-DB Version: 8951940
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Firefox
  • Version 76.0.1 (64-Bit)

"Clone Part" does not copy properties to new part

Describe the bug
I created a part with 2 properties. When using the clone button, the edit-view contains the original parts parameters correctly, for which I update the values to match the new part. When clicking on save the new, cloned part is correctly created (name, stock) but is missing the properties. The new part has no properties, instead the original parts properties are edited

Additional context
Let me know if you have problems reproducing this and I will edit this to provide more information.

.htaccess gz encoding error

Describe the bug
When using the latest master version the css and js files are not loading correctly. I just see binary garbage in the brower.

I found out that I had to change the lines

<Files *.js.gz>
    AddType "text/javascript" .gz
    AddEncoding gz .gz
</Files>
<Files *.css.gz>
    AddType "text/css" .gz
    AddEncoding gz .gz
</Files>
<Files *.svg.gz>
    AddType "image/svg+xml" .gz
    AddEncoding gz .gz
</Files>
<Files *.html.gz>
    AddType "text/html" .gz
    AddEncoding gz .gz
</Files>

to

<Files *.js.gz>
    AddType "text/javascript" .gz
    AddEncoding gzip .gz
</Files>
<Files *.css.gz>
    AddType "text/css" .gz
    AddEncoding gzip .gz
</Files>
<Files *.svg.gz>
    AddType "image/svg+xml" .gz
    AddEncoding gzip .gz
</Files>
<Files *.html.gz>
    AddType "text/html" .gz
    AddEncoding gzip .gz
</Files>

I am not sure if this is OS specific or a general typo in the .htaccess file?

Server Side

  • Part-DB Version: d4e16a8
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10
  • OS Version: Debian Buster

Desktop:

  • OS: Windows 10
  • Browser Vivaldi
  • Version 3.0.1874.38 (Stable channel) (32-Bit)

Issues after migration from 5.9 to current version

Describe the bug
Currently we try to migrate our partdb from version 5.9 to the current verison (master branch).
We followed the documentation any we got no errors while execute the migrations.
After the migrations are done we can see the page without any issues, but if we login in as admin user (dont tested other users) the whole design is broken (see screenshot).

To Reproduce
Steps to reproduce the behavior:

  1. Use the old 5.9 database
  2. Follow the migrate instructions
  3. login as admin user
  4. See error

Screenshots
Screenshot_2020-07-23 Part-DB

Server Side

  • Part-DB Version: 490f70c
  • PHP Version: 7.4.8
  • Database Server MySQL 5.7.30

Desktop (please complete the following information):

  • OS: all
  • Browser all

Additional context
The encore build (yarn build) was successfull!
The browser cant load the umen.min.css.css file, the .css.css is quite weired but domain.de/en/build/themes/lumen.min.css also dont exists.

<link rel="stylesheet" href="/build/themes/lumen.min.css.css">

In the filesystem i see that the file lumen.css (without css and .min) exists in the correct directory public/build/themes.
If i try to open that path/url (domain.de/build/themes/lumen.css) it works fine, i guess there is a issue with the path linking.

database upgrade from old part-db

Describe the bug
I tried an upgrade from the old part-db-version, but it doesn't work. At some time i get an error message, see below. I also tried to drop the database and restore the backup, but the migration also didn't work.

Server Side

  • Part-DB Version: Part-DB 1.0
  • PHP Version: 7.3
  • Database Server 10.3.22-MariaDB-0+deb10u1 Raspbian 10

Additional context

pi@raspberrypi:/var/www/part-db $ php bin/console doctrine:migrations:migrate

                Application Migrations

WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)y
Migrating up to 20200502161750 from 0

++ migrating 1 (Creates an inital empty database)

SS skipped (Reason: Old Part-DB Database detected! Continue with upgrade...)

++ migrating 20190902140506 (Upgrade database from old Part-DB 0.5 Version (dbVersion 26))

 -> SET sql_mode = ''
 -> RENAME TABLE `attachement_types` TO `attachment_types`;
 -> RENAME TABLE `attachements` TO `attachments`;
 -> CREATE TABLE currencies (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, iso_code VARCHAR(255) NOT NULL, exchange_rate NUMERIC(11, 5) DEFAULT NULL, comment LONGTEXT NOT NULL, not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_37C44693727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
 -> CREATE TABLE `measurement_units` (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, unit VARCHAR(255) DEFAULT NULL, is_integer TINYINT(1) NOT NULL, use_si_prefix TINYINT(1) NOT NULL, comment LONGTEXT NOT NULL, not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_F5AF83CF727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
 -> CREATE TABLE part_lots (id INT AUTO_INCREMENT NOT NULL, id_store_location INT DEFAULT NULL, id_part INT NOT NULL, description LONGTEXT NOT NULL, comment LONGTEXT NOT NULL, expiration_date DATETIME DEFAULT NULL, instock_unknown TINYINT(1) NOT NULL, amount DOUBLE PRECISION NOT NULL, needs_refill TINYINT(1) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_EBC8F9435D8F4B37 (id_store_location), INDEX IDX_EBC8F943C22F6CC4 (id_part), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
 -> INSERT IGNORE INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) SELECT parts.id, parts.id_storelocation,  parts.instock, 0, NOW(), NOW() FROM parts WHERE parts.instock >= 0
 -> INSERT IGNORE INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) SELECT parts.id, parts.id_storelocation, 0, 1, NOW(), NOW() FROM parts WHERE parts.instock = -2
 -> ALTER TABLE currencies ADD CONSTRAINT FK_37C44693727ACA70 FOREIGN KEY (parent_id) REFERENCES currencies (id)
 -> ALTER TABLE `measurement_units` ADD CONSTRAINT FK_F5AF83CF727ACA70 FOREIGN KEY (parent_id) REFERENCES `measurement_units` (id)
 -> ALTER TABLE part_lots ADD CONSTRAINT FK_EBC8F9435D8F4B37 FOREIGN KEY (id_store_location) REFERENCES `storelocations` (id)
 -> ALTER TABLE part_lots ADD CONSTRAINT FK_EBC8F943C22F6CC4 FOREIGN KEY (id_part) REFERENCES `parts` (id) ON DELETE CASCADE
 -> ALTER TABLE parts DROP INDEX parts_order_orderdetails_id_k, ADD UNIQUE INDEX UNIQ_6940A7FE81081E9B (order_orderdetails_id)
 -> ALTER TABLE parts DROP FOREIGN KEY parts_id_storelocation_fk
 -> DROP INDEX favorite ON parts
 -> DROP INDEX parts_id_storelocation_k ON parts
 -> ALTER TABLE parts DROP FOREIGN KEY parts_id_footprint_fk
 -> ALTER TABLE parts DROP FOREIGN KEY parts_id_manufacturer_fk
 -> ALTER TABLE parts CHANGE mininstock minamount DOUBLE PRECISION NOT NULL, ADD id_part_unit INT DEFAULT NULL, ADD manufacturer_product_number VARCHAR(255) NOT NULL, ADD manufacturing_status VARCHAR(255) DEFAULT NULL, ADD needs_review TINYINT(1) NOT NULL, ADD tags LONGTEXT NOT NULL, ADD mass DOUBLE PRECISION DEFAULT NULL, DROP instock, CHANGE id_category id_category INT NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE order_quantity order_quantity INT NOT NULL, CHANGE manual_order manual_order TINYINT(1) NOT NULL, CHANGE manufacturer_product_url manufacturer_product_url VARCHAR(255) NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE favorite favorite TINYINT(1) NOT NULL, DROP id_storelocation
 -> ALTER TABLE parts ADD CONSTRAINT FK_6940A7FE5697F554 FOREIGN KEY (id_category) REFERENCES `categories` (id)
 -> ALTER TABLE parts ADD CONSTRAINT FK_6940A7FEEBBCC786 FOREIGN KEY (id_master_picture_attachement) REFERENCES `attachments` (id)
 -> ALTER TABLE parts ADD CONSTRAINT FK_6940A7FE2626CEF9 FOREIGN KEY (id_part_unit) REFERENCES `measurement_units` (id)
 -> CREATE INDEX IDX_6940A7FEEBBCC786 ON parts (id_master_picture_attachement)
 -> CREATE INDEX IDX_6940A7FE2626CEF9 ON parts (id_part_unit)
 -> CREATE INDEX IDX_6940A7FE5697F554 ON parts (id_category)
 -> DROP INDEX parts_id_category_k ON parts
 -> DROP INDEX parts_id_footprint_k ON parts
 -> CREATE INDEX IDX_6940A7FE7E371A10 ON parts (id_footprint)
 -> DROP INDEX parts_id_manufacturer_k ON parts
 -> CREATE INDEX IDX_6940A7FE1ECB93AE ON parts (id_manufacturer)
 -> ALTER TABLE parts ADD CONSTRAINT parts_id_footprint_fk FOREIGN KEY (id_footprint) REFERENCES footprints (id)
 -> ALTER TABLE parts ADD CONSTRAINT parts_id_manufacturer_fk FOREIGN KEY (id_manufacturer) REFERENCES manufacturers (id)
 -> ALTER TABLE attachment_types DROP FOREIGN KEY attachement_types_parent_id_fk
 -> ALTER TABLE attachment_types ADD filetype_filter LONGTEXT NOT NULL, ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
 -> DROP INDEX attachement_types_parent_id_k ON attachment_types
 -> CREATE INDEX IDX_EFAED719727ACA70 ON attachment_types (parent_id)
 -> ALTER TABLE attachment_types ADD CONSTRAINT attachement_types_parent_id_fk FOREIGN KEY (parent_id) REFERENCES attachment_types (id)
 -> ALTER TABLE categories DROP FOREIGN KEY categories_parent_id_fk
 -> ALTER TABLE categories ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE disable_footprints disable_footprints TINYINT(1) NOT NULL, CHANGE disable_manufacturers disable_manufacturers TINYINT(1) NOT NULL, CHANGE disable_autodatasheets disable_autodatasheets TINYINT(1) NOT NULL, CHANGE disable_properties disable_properties TINYINT(1) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
 -> DROP INDEX categories_parent_id_k ON categories
 -> CREATE INDEX IDX_3AF34668727ACA70 ON categories (parent_id)
 -> ALTER TABLE categories ADD CONSTRAINT categories_parent_id_fk FOREIGN KEY (parent_id) REFERENCES categories (id)
 -> ALTER TABLE devices DROP FOREIGN KEY devices_parent_id_fk
 -> ALTER TABLE devices ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE order_quantity order_quantity INT NOT NULL, CHANGE order_only_missing_parts order_only_missing_parts TINYINT(1) NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE comment comment LONGTEXT NOT NULL
 -> DROP INDEX devices_parent_id_k ON devices
 -> CREATE INDEX IDX_11074E9A727ACA70 ON devices (parent_id)
 -> ALTER TABLE devices ADD CONSTRAINT devices_parent_id_fk FOREIGN KEY (parent_id) REFERENCES devices (id)
 -> ALTER TABLE footprints DROP FOREIGN KEY footprints_parent_id_fk
 -> ALTER TABLE footprints ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
 -> DROP INDEX footprints_parent_id_k ON footprints
 -> CREATE INDEX IDX_A34D68A2727ACA70 ON footprints (parent_id)
 -> ALTER TABLE footprints ADD CONSTRAINT footprints_parent_id_fk FOREIGN KEY (parent_id) REFERENCES footprints (id)
 -> ALTER TABLE manufacturers DROP FOREIGN KEY manufacturers_parent_id_fk
 -> ALTER TABLE manufacturers ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE address address VARCHAR(255) NOT NULL, CHANGE phone_number phone_number VARCHAR(255) NOT NULL, CHANGE fax_number fax_number VARCHAR(255) NOT NULL, CHANGE email_address email_address VARCHAR(255) NOT NULL, CHANGE website website VARCHAR(255) NOT NULL, CHANGE auto_product_url auto_product_url VARCHAR(255) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
 -> DROP INDEX manufacturers_parent_id_k ON manufacturers
 -> CREATE INDEX IDX_94565B12727ACA70 ON manufacturers (parent_id)
 -> ALTER TABLE manufacturers ADD CONSTRAINT manufacturers_parent_id_fk FOREIGN KEY (parent_id) REFERENCES manufacturers (id)
 -> ALTER TABLE storelocations DROP FOREIGN KEY storelocations_parent_id_fk
 -> ALTER TABLE storelocations ADD storage_type_id INT DEFAULT NULL, ADD only_single_part TINYINT(1) NOT NULL, ADD limit_to_existing_parts TINYINT(1) NOT NULL, ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE is_full is_full TINYINT(1) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
 -> ALTER TABLE storelocations ADD CONSTRAINT FK_7517020B270BFF1 FOREIGN KEY (storage_type_id) REFERENCES `measurement_units` (id)
 -> CREATE INDEX IDX_7517020B270BFF1 ON storelocations (storage_type_id)
 -> DROP INDEX storelocations_parent_id_k ON storelocations
 -> CREATE INDEX IDX_7517020727ACA70 ON storelocations (parent_id)
 -> ALTER TABLE storelocations ADD CONSTRAINT storelocations_parent_id_fk FOREIGN KEY (parent_id) REFERENCES storelocations (id)
 -> ALTER TABLE suppliers DROP FOREIGN KEY suppliers_parent_id_fk
 -> ALTER TABLE suppliers ADD default_currency_id INT DEFAULT NULL, ADD shipping_costs NUMERIC(11, 5) DEFAULT NULL, ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE address address VARCHAR(255) NOT NULL, CHANGE phone_number phone_number VARCHAR(255) NOT NULL, CHANGE fax_number fax_number VARCHAR(255) NOT NULL, CHANGE email_address email_address VARCHAR(255) NOT NULL, CHANGE website website VARCHAR(255) NOT NULL, CHANGE auto_product_url auto_product_url VARCHAR(255) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
 -> ALTER TABLE suppliers ADD CONSTRAINT FK_AC28B95CECD792C0 FOREIGN KEY (default_currency_id) REFERENCES currencies (id)
 -> CREATE INDEX IDX_AC28B95CECD792C0 ON suppliers (default_currency_id)
 -> DROP INDEX suppliers_parent_id_k ON suppliers
 -> CREATE INDEX IDX_AC28B95C727ACA70 ON suppliers (parent_id)
 -> ALTER TABLE suppliers ADD CONSTRAINT suppliers_parent_id_fk FOREIGN KEY (parent_id) REFERENCES suppliers (id)
 -> DROP INDEX attachements_class_name_k ON attachments
 -> ALTER TABLE attachments DROP FOREIGN KEY attachements_type_id_fk
 -> ALTER TABLE attachments ADD datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE type_id type_id INT DEFAULT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE filename filename VARCHAR(255) NOT NULL, CHANGE show_in_table show_in_table TINYINT(1) NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
 -> ALTER TABLE attachments ADD CONSTRAINT FK_47C4FAD61F1F2A24 FOREIGN KEY (element_id) REFERENCES `parts` (id) ON DELETE CASCADE
 -> DROP INDEX attachements_type_id_fk ON attachments
 -> CREATE INDEX IDX_47C4FAD6C54C8C93 ON attachments (type_id)
 -> CREATE INDEX IDX_47C4FAD61F1F2A24 ON attachments (element_id)
 -> DROP INDEX attachements_element_id_k ON attachments
 -> ALTER TABLE attachments ADD CONSTRAINT attachements_type_id_fk FOREIGN KEY (type_id) REFERENCES attachment_types (id)
 -> ALTER TABLE users CHANGE name name VARCHAR(180) NOT NULL, CHANGE first_name first_name VARCHAR(255) DEFAULT NULL, CHANGE last_name last_name VARCHAR(255) DEFAULT NULL, CHANGE department department VARCHAR(255) DEFAULT NULL, CHANGE email email VARCHAR(255) DEFAULT NULL, CHANGE need_pw_change need_pw_change TINYINT(1) NOT NULL, CHANGE config_language config_language VARCHAR(255) DEFAULT NULL, CHANGE config_timezone config_timezone VARCHAR(255) DEFAULT NULL, CHANGE config_theme config_theme VARCHAR(255) DEFAULT NULL, CHANGE config_currency config_currency VARCHAR(255) NOT NULL, CHANGE perms_labels perms_labels INT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
 -> ALTER TABLE users ADD CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES `groups` (id)

Migration 20190902140506 failed during Execution. Error An exception occurred while executing 'ALTER TABLE users ADD CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)':

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (partdb.#sql-2fec_40, CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id))
13:03:30 ERROR [console] Error thrown while running command "doctrine:migrations:migrate". Message: "An exception occurred while executing 'ALTER TABLE users ADD CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)':\n\nSQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (partdb.#sql-2fec_40, CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id))" ["exception" => Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException^ { …},"command" => "doctrine:migrations:migrate","message" => """ An exception occurred while executing 'ALTER TABLE users ADD CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)':\n \n SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (partdb.#sql-2fec_40, CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)) """]

In AbstractMySQLDriver.php line 49:

An exception occurred while executing 'ALTER TABLE users ADD CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)':

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (partdb.#sql-2fec_40, CONSTRA
INT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id))

In PDOConnection.php line 83:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (partdb.#sql-2fec_40, CONSTRA
INT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id))

In PDOConnection.php line 78:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (partdb.#sql-2fec_40, CONSTRA
INT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id))

doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration [CONFIGURATION]] [--db-configuration [DB-CONFIGURATION]] [--db DB] [--em EM] [--shard SHARD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] []

pi@raspberrypi:/var/www/part-db $ php bin/console doctrine:migrations:migrate

                Application Migrations

WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)y
Migrating up to 20200502161750 from 1

++ migrating 20190902140506 (Upgrade database from old Part-DB 0.5 Version (dbVersion 26))

 -> SET sql_mode = ''
 -> RENAME TABLE `attachement_types` TO `attachment_types`;

Migration 20190902140506 failed during Execution. Error An exception occurred while executing 'RENAME TABLE attachement_types TO attachment_types;':

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists
13:04:44 ERROR [console] Error thrown while running command "doctrine:migrations:migrate". Message: "An exception occurred while executing 'RENAME TABLE attachement_types TO attachment_types;':\n\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists" ["exception" => Doctrine\DBAL\Exception\TableExistsException^ { …},"command" => "doctrine:migrations:migrate","message" => """ An exception occurred while executing 'RENAME TABLE attachement_types TO attachment_types;':\n \n SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists """]

In AbstractMySQLDriver.php line 38:

An exception occurred while executing 'RENAME TABLE attachement_types TO attachment_types;':

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists

In PDOConnection.php line 83:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists

In PDOConnection.php line 78:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists

doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration [CONFIGURATION]] [--db-configuration [DB-CONFIGURATION]] [--db DB] [--em EM] [--shard SHARD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] []

Expiration date wrong

I enter this date:
image

I click on save changes:
image

The correct date is saved:
image

But when i click on edit to change for example the amount, there is the wrong date filled in and the wrong date will be saved. The difference is always 1 hour.

Despite this bug, i think the important thing is the date and the time should be optional.

Error while opening part when exchange rate is empty

Describe the bug
If the exchange rate for a currency is empty I get the following error when opening a part
[2020-04-06 14:40:54] request.CRITICAL: Uncaught PHP Exception TypeError: "bcadd() expects parameter 2 to be string, null given" at /var/www/partdb/src/Services/PricedetailHelper.php line 177 {"exception":"[object] (TypeError(code: 0): bcadd() expects parameter 2 to be string, null given at /var/www/partdb/src/Services/PricedetailHelper.php:177)"} []

To Reproduce
Steps to reproduce the behavior:

  1. Create a currency with a empty ("") exchange rate
  2. Assign this exchange rate to a supplier
  3. Add this supplier to a part, enter some prices and save the part
  4. Try to open the part again

Expected behavior
Default value for the exchange rate should be 1. An empty value shouldn't be allowed.

Server Side

  • Part-DB Version: e654c46
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Vivaldi
  • Version 2.11.1811.52 (Stable channel) (32-Bit)

Additional context
I am not sure whether you already like such error reports for the dev version?

Part categories

I think this feature is not that important, because alternatives and the partnumber it self can be found also by using the distributor search, then in the database the part can be selected.
The idea is to combine this database with an EDA tool (for example https://kicad-pcb.org/). And so automatically assigning automatically properties and footprint (https://forum.kicad.info/t/automatic-assignement-of-footprint-and-3d-model/24497).

Is your feature request related to a problem? Please describe.
Distributors are using categories to sort their parts. So each category has it's own list of parameter which can be selected.
For example ThinkFilm Resistors:

Mouser: All Products -> Passive Components -> Resistors SMD Resistors / Chip Resistors -> Thick Film Resistors

The Thick Film Resistors category has the properties :Manufacturer, Series, Resistance, Power Rating, Tolerance, Temperature Coefficient, Case Code ...
The upper category (Resistors SMD Resistors / Chip Resistors) has only the properties: Manufacturer, Resistance, Tolerance, Power Rating, Case Code

This is usefull for finding alternatives.

Describe the solution you'd like
It would be nice it is possible to create categories, subcategories and so on (which have specific properties which can be used to find a part).
Each part can then be assigned to a categorie (get assigned also the upper categorie). So searching for a specific part becomes quite easy

Error 500 when deleting image from part

Describe the bug
I deleted a image from a part (the image was the preview image as well) and got the following error:
[2020-05-09 18:16:53] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException: "An exception occurred while executing 'DELETE FROM attachments WHERE id = ?' with params [25]: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (partdb.parts, CONSTRAINT FK_6940A7FE6DEDCEC2 FOREIGN KEY (id_preview_attachement) REFERENCES attachments (id))" at /var/www/partdb/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 49 {"exception":"[object] (Doctrine\\DBAL\\Exception\\ForeignKeyConstraintViolationException(code: 0): An exception occurred while executing 'DELETE FROM attachments WHERE id = ?' with params [25]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (partdb.parts, CONSTRAINT FK_6940A7FE6DEDCEC2 FOREIGN KEY (id_preview_attachement) REFERENCES attachments (id)) at /var/www/partdb/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:49, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (partdb.parts, CONSTRAINT FK_6940A7FE6DEDCEC2 FOREIGN KEY (id_preview_attachement) REFERENCES attachments (id)) at /var/www/partdb/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (partdb.parts, CONSTRAINT FK_6940A7FE6DEDCEC2 FOREIGN KEY (id_preview_attachement) REFERENCES attachments (id)) at /var/www/partdb/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)"} []

To Reproduce
Steps to reproduce the behavior:

  1. Open part https://part-db.herokuapp.com/en/part/964/edit
  2. Click Attachments
  3. Click Delete
  4. Click Save Changes
  5. See error

Expected behavior
No Error message and deleted image

Server Side

  • Part-DB Version: aafe018
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Vivaldi
  • Version 3.0.1874.38 (Stable channel) (32-Bit)

Wrong Translation for Store Location Statistic

Describe the bug
As shown in the attached screenshot, I think the text "Übergeordnetes Element" shows the amount of parts in the store location not the parent element.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Server Side

  • Part-DB Version: fe405aa
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Firefox
  • Version 76.0.1 (64-Bit)

backup/restore documentation

Is your feature request related to a problem? Please describe.
The old part-db had documentation on what was needed to backup an what was needed to restore

Describe the solution you'd like
List of files / directories to backup

Describe alternatives you've considered
A php script to create an backup archive like php bin/console backup:{create, restore}

Suggestion: Purchase Orders

From Part-DB #74

I really like the look of the DEMO site and am thinking of using this for my inventory needs. My question is:

How to best enter parts from a purchase order?

Would that be by tools - import - csv? Which means I need to make a csv file from the PO or do I need to go to each part and add stock?


I think I might have found it. It doesn't look like you can make/add a PO but you can just see a list of parts that need to be order per supplier. Then I guess you just have to check the ADD STOCK box when they show up.

Would be nice if there was a check box for 'ordered' or 'awaiting arrival' or 'on PO' or something. So, if you are waiting for ordered parts to arrive but your getting ready to place a 2nd order there isn't just one big list of everything on there.

Error 500 when adding a file to a part

Describe the bug
When I try to add a file to a part I get the following error message:

[2020-06-01T13:05:12.791473+02:00] php.CRITICAL: Uncaught Error: Call to a member function getData() on null {"exception":"[object] (Error(code: 0): Call to a member function getData() on null at /var/www/partdb/src/Validator/Constraints/AllowedFileExtensionValidator.php:79)"} []
[2020-06-01T13:05:12.795361+02:00] request.CRITICAL: Uncaught PHP Exception Error: "Call to a member function getData() on null" at /var/www/partdb/src/Validator/Constraints/AllowedFileExtensionValidator.php line 79 {"exception":"[object] (Error(code: 0): Call to a member function getData() on null at /var/www/partdb/src/Validator/Constraints/AllowedFileExtensionValidator.php:79)"} []

To Reproduce
Steps to reproduce the behavior:

  1. Create a device
  2. Save it
  3. Click on 'Attachments'
  4. Click 'Add Attachment'
  5. Use Type 'Bilder' and fill name and Upload file
  6. Press 'Save changes'
  7. See error

Server Side

  • Part-DB Version: aa95f13
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Firefox
  • Version 76.0.1 (64-Bit)

Error 500 when displaying statistics

Describe the bug
Statistics show error (500) when no items with stock are available.
[2020-04-06 14:49:21] request.CRITICAL: Uncaught PHP Exception TypeError: "Return value of App\Repository\PartRepository::getPartsInstockSum() must be of the type string, null returned" at /var/www/partdb/src/Repository/PartRepository.php line 68 {"exception":"[object] (TypeError(code: 0): Return value of App\\Repository\\PartRepository::getPartsInstockSum() must be of the type string, null returned at /var/www/partdb/src/Repository/PartRepository.php:68)"} []

To Reproduce
Steps to reproduce the behavior:

  1. Having a new installation with only one part without any stock
  2. Click Tools --> Show --> Statistics

Expected behavior
Maybe the function getPartsInstockSum should return 0 instead of null?

Server Side

  • Part-DB Version: e654c46
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Vivaldi
  • Version 2.11.1811.52 (Stable channel) (32-Bit)

Additional context
I am not sure whether you already like such error reports for the dev version?

Bauteil kopieren erzeugt falschen Logeintrag

Ich habe auf Bauteil kopieren geklickt:
image

Nach dem kopieren, erscheint im zu kopierenden Teil im Log, dass der Preis geändert wurde.
image

Ich hätte auch erwartet, dass Einkaufsinformationen mit auf das neue Teil übertragen werden, die sind dort aber nicht hinterlegt. Ich weiß nicht ob das beabsichtigt ist.

Check for argon2 in php?

It taken me few days on gentoo to get a grip on silent 500 error due to php compiled without '--with-password-argon2' flag.

Is it straightforward to check for that with composer?
Adding it to composer.json like

        "php": "^7.2.5",
        "ext-bcmath": "*",
        "ext-ctype": "*",
        "ext-gd": "*",
        "ext-iconv": "*",
        "ext-intl": "*",
        "ext-json": "*",
        "ext-mbstring": "*",
        "ext-password-argon2": "*"

doesn't work.

Unable to move a footprint to a category which is configured as "not selectable"

Describe the bug
It is only possible to move a footprint to a category which is NOT configured as "not selectable". During the creation of a footprint all parents can be selected, but when editing the same footprint it's not possible to select footprints configured as "not selectable".

To Reproduce
Steps to reproduce the behavior:

  1. Create a footprint and call it "a" --> configure as "not selectable" --> Save
  2. Create a footprint and call it "b" --> don't choose any parent --> Save
  3. Open footprint "b" again and try to assign it to parent "a"

Expected behavior
Do I understand the "not selectable" flag wrong? I assumed it should only apply when selecting parts and not for e.g. moving one footprint from one parent to another.

Server Side

  • Part-DB Version: e654c46
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Vivaldi
  • Version 2.11.1811.52 (Stable channel) (32-Bit)

Additional context
I am not sure whether you already like such error reports for the dev version?

Missing translations

Describe the bug
The following strings are not translated (they exist in crowdin but it seems not to work:

Server Side
Demo Server https://part-db.herokuapp.com/en

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Vivaldi
  • Version 3.0.1874.38 (Stable channel) (32-Bit)

Empty page when creating new element (user/category etc)

Describe the bug
When I create a new element (like a user or a category) and pressed save, I just get a empty page. The problem also occurs in the demo instance

To Reproduce
Steps to reproduce the behavior:

  1. Go to Tools --> Edit --> Category
  2. Enter a Name
  3. Press Save

Expected behavior
Either redirect to element list or show the saved element

Server Side

  • Part-DB Version: e654c46
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Vivaldi
  • Version 2.11.1811.52 (Stable channel) (32-Bit)

Additional context
I am not sure whether you already like such error reports for the dev version?

Mass-Creation of Parts

Is your feature request related to a problem? Please describe.
When importing multiple similar parts (e.g. I have a box of trim potis - every property is the same, except the resistance) - adding them all, requires a lot of manual repetitive work.

Describe the solution you'd like
Allow for the mass-creation, e.g. by selecting a base-item, provide a "more like this" button and then proving a CSV field to overwrite properties of the base-item (maybe using placeholders in the base-item?)

Describe alternatives you've considered
A simple fix could consist of a save & create more like this button allowing to create a second copy of a created part, so only the changed property has to be changed on the new part.

Part-DB 1.0 Milestone development discussion / Roadmap

The purpose of this issue is to allow discussions about the development of Part-DB 1.0 and create a roadmap for further development:

I have added kanban boards (https://github.com/Part-DB/Part-DB-symfony/projects) for all features I would want to see in (near) future Part-DB versions. Not everything must be in the Part-DB 1.0 milestone, but can be implemented in later versions too.

I think for the Part-DB 1.0 release it would be useful to implement all features of the old Part-DB versions (Part-DB 0.5/0.6), to allow existing users to migrate to the new version and to profit by the new "comfort features" quickly. Also this has the advantage that we don't have to maintain two completely different versions at the same time for long.

To achieve this I would recommend that the development of Part-DB 1.0 concentrates on implementing the features missing in comparison to the old versions. That does not mean that new features are completely forbidden, in many cases it is very reasonable to implement new features, especially when they are related to the architecture or would be difficult to add in a later stage of development (like logging system):

For example the project management and order system in the old versions is very odd and not really useful for real life applications. For Part-DB 1.0 these features should be implemented in a meaningful way (with a new architecture), which automatically will add new features. If these deep changes the architecture would be introduced in later versions, it would be more work to implement the new features than doing it now all at once.

Besides the development of the codebase there are also some other things that has to be done for a good Part-DB 1.0 milestone: Documentation/Help (especially on the usage) and maybe some additional translations.

If you have ideas, critique or recommendations about this topic, feel free to discuss it in this issue,

When duplicating a part, the attachments aren't duplicated

Describe the bug
If I duplicate a part with an attachment, the attachment itself is not duplicated as well. That means, if I delete the attachment from the new (duplicated part) the attachment is also removed from the orignial part.

Expected behavior
I would have expected that the attachments are copied on the hard disc.

Server Side

  • Part-DB Version: 59d1349
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Firefox
  • Version 77.0.1 (64-Bit)

Error when executing doctrine:migrations:migrate

Describe the bug
When executed doctrine:migrations:migrate I got the following error message:

03:38:13 ERROR     [console] Error thrown while running command "doctrine:migrations:migrate". Message: "The metadata storage is not up to date, please run the sync-metadata-storage command to fix rine\Migrations\Exception\MetadataStorageError^ { …},"command" => "doctrine:migrations:migrate","message" => "The metadata storage is not up to date, please run the sync-metadata-storage command to

In MetadataStorageError.php line 13:

  The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue.


doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--db-configuration DB-COiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<version>]

At first when I executed doctrine:migrations:sync-metadata-storage I got the same exception. I fixed this by setting the right serverVersion in the .env.local file:

sudo -u www-data bin/console doctrine:migrations:sync-metadata-storage -vvv


 [OK] Metadata storage synchronized

When then executing doctrine:migrations:migrate I got the following error message:

sudo -u www-data php bin/console doctrine:migrations:migrate                                                                                                           
 WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
 >

10:59:57 ERROR     [app] Migration DoctrineMigrations\Version1 failed during Execution. Error: "An exception occurred while executing 'CREATE TABLE `attachment_types` (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, filetype_filter LONGTEXT NOT NULL, comment LONGTEXT NOT NULL, not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_EFAED719727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':\n\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists" ["version" => "DoctrineMigrations\Version1","error" => """  An exception occurred while executing 'CREATE TABLE `attachment_types` (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, filetype_filter LONGTEXT NOT NULL, comment LONGTEXT NOT NULL, not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_EFAED719727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':\n  \n  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists  ""","state" => "Execution"]
10:59:57 ERROR     [console] Error thrown while running command "doctrine:migrations:migrate". Message: "An exception occurred while executing 'CREATE TABLE `attachment_types` (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, filetype_filter LONGTEXT NOT NULL, comment LONGTEXT NOT NULL, not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_EFAED719727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':\n\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists" ["exception" => Doctrine\DBAL\Exception\TableExistsException^ { …},"command" => "doctrine:migrations:migrate","message" => """  An exception occurred while executing 'CREATE TABLE `attachment_types` (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, filetype_filter LONGTEXT NOT NULL, comment LONGTEXT NOT NULL, not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_EFAED719727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':\n  \n  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists  """]

In AbstractMySQLDriver.php line 38:

  An exception occurred while executing 'CREATE TABLE `attachment_types` (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, filetype_filter LONGTEXT NOT NULL, comment LONGTEXT NOT NULL
  , not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX I
  DX_EFAED719727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists


In PDOConnection.php line 43:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists


In PDOConnection.php line 41:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachment_types' already exists


doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--db-configuration DB-CONFIGURATION] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<version>]

I found out that I have two different tables in the database: doctrine_migration_versions and migration_versions. The first one is empty, the second one contains the already executed migrations:

+----------------+---------------------+
| version        | executed_at         |
+----------------+---------------------+
| 1              | 2020-04-06 11:35:50 |
| 20190902140506 | 2020-04-06 11:35:50 |
| 20190913141126 | 2020-04-06 11:35:50 |
| 20190924113252 | 2020-04-06 11:35:52 |
| 20191214153125 | 2020-04-06 11:35:52 |
| 20200126191823 | 2020-04-06 11:35:52 |
| 20200311204104 | 2020-04-06 11:35:52 |
| 20200409130946 | 2020-04-13 19:31:11 |
| 20200502161750 | 2020-05-10 12:43:42 |
+----------------+---------------------+

Server Side

  • Part-DB Version: a02526c
  • PHP Version: PHP 7.3.19-1+0~20200612.60+debian10~1.gbp6c8fe1 (cli) (built: Jun 12 2020 07:48:33) ( NTS )
  • Database Server 10.3.22-MariaDB-0+deb10u1 for debian-linux-gnu on x86_64 (Debian 10)

"Create new Part" button on "not selectable" categories

Describe the bug
When selecting a category in the category list a button called "create new part" appears. But this button also appears if the category is marked as "not selectable". (also occurs in the demo system)

To Reproduce
Steps to reproduce the behavior:

  1. Go to Categories and choose a category which is marked as "not selectable".
  2. Press the "Create new part" button (which should maybe not be visible)
  3. The "not selectable" category is pre-selected (which should not be possible)

Expected behavior
Hide the button on "not selectable" categories.

Server Side

  • Part-DB Version: e654c46
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Vivaldi
  • Version 2.11.1811.52 (Stable channel) (32-Bit)

Additional context
I am not sure whether you already like such error reports for the dev version?

Different API response / a suggestion

Hello,

it would be great to have a restful API according some standards whit basic CRUD operations.
What i mean is, there some different while fetching data.

For example:
A list of parts gets a JSON response:
https://part-db.herokuapp.com/de/category/17/parts

A single part get a HTML (Template) response:
https://part-db.herokuapp.com/de/part/799/info

What the benefit:

  • FrontEnd (JS) and BackEnd (PHP) are splitted ( maybe in two projects / repos ).
    • FE is using ReactJS, VueJS, Angular, or hardcore Plain JS or whatever ...
  • ... for building some (Crossplattform) Applications

Anyway, it is a very nice project i am (long time) searching for.
This is a suggestion only.

Have a nice day,
Regards, Thomas

Error 500 when adding stock to part

Describe the bug
I created a part, saved it and tried to add stock. I got the following error message:
[2020-05-17T14:51:05.730722+02:00] request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMInvalidArgumentException: "Binding entities to query parameters only allowed for entities that have an identifier." at /var/www/partdb/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php line 207 {"exception":"[object] (Doctrine\\ORM\\ORMInvalidArgumentException(code: 0): Binding entities to query parameters only allowed for entities that have an identifier. at /var/www/partdb/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:207)"} []

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://part-db.herokuapp.com/en/part/970/edit#part_lots
  2. Click on Add stock
  3. Select a storage location, enter any amount
  4. See error

Server Side

  • Part-DB Version: cad9534
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Firefox
  • Version 76.0.1 (64-Bit)

Drop index on groups failes when upgrading from part-db-0.6.0 to 1.0

Describe the bug
When running php bin/console doctrine:migrations:migrate to upgrade my part-db-0.6.0 to 1.0 I run into an issue when it tried to drop the index "name" on table "groups".

Additional Info:
I use the docker-instance of partdb-symfony as given in the hint. The APP_ENV was set to prod (docker env as also the .env.local file) and .env.local was updated to point to a copy of my old databse.

To Reproduce

  1. Update .env.local to point to the partdb-0.6.0 database.
  2. run php bin/console doctrine:migrations:migrate
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Output Migration script

php bin/console doctrine:migrations:migrate
                                                              
                    Application Migrations                    
                                                              

WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)y
Migrating up to 20200502161750 from 0

  ++ migrating 1 (Creates an inital empty database)


  SS skipped (Reason: Old Part-DB Database detected! Continue with upgrade...)

  ++ migrating 20190902140506 (Upgrade database from old Part-DB 0.5 Version (dbVersion 26))

     -> SET sql_mode = ''
     -> RENAME TABLE `attachement_types` TO `attachment_types`;
     -> RENAME TABLE `attachements` TO `attachments`;
     -> CREATE TABLE currencies (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, iso_code VARCHAR(255) NOT NULL, exchange_rate NUMERIC(11, 5) DEFAULT NULL, comment LONGTEXT NOT NULL, not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_37C44693727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
     -> CREATE TABLE `measurement_units` (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, unit VARCHAR(255) DEFAULT NULL, is_integer TINYINT(1) NOT NULL, use_si_prefix TINYINT(1) NOT NULL, comment LONGTEXT NOT NULL, not_selectable TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_F5AF83CF727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
     -> CREATE TABLE part_lots (id INT AUTO_INCREMENT NOT NULL, id_store_location INT DEFAULT NULL, id_part INT NOT NULL, description LONGTEXT NOT NULL, comment LONGTEXT NOT NULL, expiration_date DATETIME DEFAULT NULL, instock_unknown TINYINT(1) NOT NULL, amount DOUBLE PRECISION NOT NULL, needs_refill TINYINT(1) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, INDEX IDX_EBC8F9435D8F4B37 (id_store_location), INDEX IDX_EBC8F943C22F6CC4 (id_part), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
     -> INSERT IGNORE INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) SELECT parts.id, parts.id_storelocation,  parts.instock, 0, NOW(), NOW() FROM parts WHERE parts.instock >= 0
     -> INSERT IGNORE INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) SELECT parts.id, parts.id_storelocation, 0, 1, NOW(), NOW() FROM parts WHERE parts.instock = -2
     -> ALTER TABLE currencies ADD CONSTRAINT FK_37C44693727ACA70 FOREIGN KEY (parent_id) REFERENCES currencies (id)
     -> ALTER TABLE `measurement_units` ADD CONSTRAINT FK_F5AF83CF727ACA70 FOREIGN KEY (parent_id) REFERENCES `measurement_units` (id)
     -> ALTER TABLE part_lots ADD CONSTRAINT FK_EBC8F9435D8F4B37 FOREIGN KEY (id_store_location) REFERENCES `storelocations` (id)
     -> ALTER TABLE part_lots ADD CONSTRAINT FK_EBC8F943C22F6CC4 FOREIGN KEY (id_part) REFERENCES `parts` (id) ON DELETE CASCADE
     -> ALTER TABLE parts DROP INDEX parts_order_orderdetails_id_k, ADD UNIQUE INDEX UNIQ_6940A7FE81081E9B (order_orderdetails_id)
     -> ALTER TABLE parts DROP FOREIGN KEY parts_id_storelocation_fk
     -> DROP INDEX favorite ON parts
     -> DROP INDEX parts_id_storelocation_k ON parts
     -> ALTER TABLE parts DROP FOREIGN KEY parts_id_footprint_fk
     -> ALTER TABLE parts DROP FOREIGN KEY parts_id_manufacturer_fk
     -> ALTER TABLE parts CHANGE mininstock minamount DOUBLE PRECISION NOT NULL, ADD id_part_unit INT DEFAULT NULL, ADD manufacturer_product_number VARCHAR(255) NOT NULL, ADD manufacturing_status VARCHAR(255) DEFAULT NULL, ADD needs_review TINYINT(1) NOT NULL, ADD tags LONGTEXT NOT NULL, ADD mass DOUBLE PRECISION DEFAULT NULL, DROP instock, CHANGE id_category id_category INT NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE order_quantity order_quantity INT NOT NULL, CHANGE manual_order manual_order TINYINT(1) NOT NULL, CHANGE manufacturer_product_url manufacturer_product_url VARCHAR(255) NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE favorite favorite TINYINT(1) NOT NULL, DROP id_storelocation
     -> ALTER TABLE parts ADD CONSTRAINT FK_6940A7FE5697F554 FOREIGN KEY (id_category) REFERENCES `categories` (id)
     -> ALTER TABLE parts ADD CONSTRAINT FK_6940A7FEEBBCC786 FOREIGN KEY (id_master_picture_attachement) REFERENCES `attachments` (id)
     -> ALTER TABLE parts ADD CONSTRAINT FK_6940A7FE2626CEF9 FOREIGN KEY (id_part_unit) REFERENCES `measurement_units` (id)
     -> CREATE INDEX IDX_6940A7FEEBBCC786 ON parts (id_master_picture_attachement)
     -> CREATE INDEX IDX_6940A7FE2626CEF9 ON parts (id_part_unit)
     -> CREATE INDEX IDX_6940A7FE5697F554 ON parts (id_category)
     -> DROP INDEX parts_id_category_k ON parts
     -> DROP INDEX parts_id_footprint_k ON parts
     -> CREATE INDEX IDX_6940A7FE7E371A10 ON parts (id_footprint)
     -> DROP INDEX parts_id_manufacturer_k ON parts
     -> CREATE INDEX IDX_6940A7FE1ECB93AE ON parts (id_manufacturer)
     -> ALTER TABLE parts ADD CONSTRAINT parts_id_footprint_fk FOREIGN KEY (id_footprint) REFERENCES footprints (id)
     -> ALTER TABLE parts ADD CONSTRAINT parts_id_manufacturer_fk FOREIGN KEY (id_manufacturer) REFERENCES manufacturers (id)
     -> ALTER TABLE attachment_types DROP FOREIGN KEY attachement_types_parent_id_fk
     -> ALTER TABLE attachment_types ADD filetype_filter LONGTEXT NOT NULL, ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
     -> DROP INDEX attachement_types_parent_id_k ON attachment_types
     -> CREATE INDEX IDX_EFAED719727ACA70 ON attachment_types (parent_id)
     -> ALTER TABLE attachment_types ADD CONSTRAINT attachement_types_parent_id_fk FOREIGN KEY (parent_id) REFERENCES attachment_types (id)
     -> ALTER TABLE categories DROP FOREIGN KEY categories_parent_id_fk
     -> ALTER TABLE categories ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE disable_footprints disable_footprints TINYINT(1) NOT NULL, CHANGE disable_manufacturers disable_manufacturers TINYINT(1) NOT NULL, CHANGE disable_autodatasheets disable_autodatasheets TINYINT(1) NOT NULL, CHANGE disable_properties disable_properties TINYINT(1) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
     -> DROP INDEX categories_parent_id_k ON categories
     -> CREATE INDEX IDX_3AF34668727ACA70 ON categories (parent_id)
     -> ALTER TABLE categories ADD CONSTRAINT categories_parent_id_fk FOREIGN KEY (parent_id) REFERENCES categories (id)
     -> ALTER TABLE devices DROP FOREIGN KEY devices_parent_id_fk
     -> ALTER TABLE devices ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE order_quantity order_quantity INT NOT NULL, CHANGE order_only_missing_parts order_only_missing_parts TINYINT(1) NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE comment comment LONGTEXT NOT NULL
     -> DROP INDEX devices_parent_id_k ON devices
     -> CREATE INDEX IDX_11074E9A727ACA70 ON devices (parent_id)
     -> ALTER TABLE devices ADD CONSTRAINT devices_parent_id_fk FOREIGN KEY (parent_id) REFERENCES devices (id)
     -> ALTER TABLE footprints DROP FOREIGN KEY footprints_parent_id_fk
     -> ALTER TABLE footprints ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
     -> DROP INDEX footprints_parent_id_k ON footprints
     -> CREATE INDEX IDX_A34D68A2727ACA70 ON footprints (parent_id)
     -> ALTER TABLE footprints ADD CONSTRAINT footprints_parent_id_fk FOREIGN KEY (parent_id) REFERENCES footprints (id)
     -> ALTER TABLE manufacturers DROP FOREIGN KEY manufacturers_parent_id_fk
     -> ALTER TABLE manufacturers ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE address address VARCHAR(255) NOT NULL, CHANGE phone_number phone_number VARCHAR(255) NOT NULL, CHANGE fax_number fax_number VARCHAR(255) NOT NULL, CHANGE email_address email_address VARCHAR(255) NOT NULL, CHANGE website website VARCHAR(255) NOT NULL, CHANGE auto_product_url auto_product_url VARCHAR(255) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
     -> DROP INDEX manufacturers_parent_id_k ON manufacturers
     -> CREATE INDEX IDX_94565B12727ACA70 ON manufacturers (parent_id)
     -> ALTER TABLE manufacturers ADD CONSTRAINT manufacturers_parent_id_fk FOREIGN KEY (parent_id) REFERENCES manufacturers (id)
     -> ALTER TABLE storelocations DROP FOREIGN KEY storelocations_parent_id_fk
     -> ALTER TABLE storelocations ADD storage_type_id INT DEFAULT NULL, ADD only_single_part TINYINT(1) NOT NULL, ADD limit_to_existing_parts TINYINT(1) NOT NULL, ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE is_full is_full TINYINT(1) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
     -> ALTER TABLE storelocations ADD CONSTRAINT FK_7517020B270BFF1 FOREIGN KEY (storage_type_id) REFERENCES `measurement_units` (id)
     -> CREATE INDEX IDX_7517020B270BFF1 ON storelocations (storage_type_id)
     -> DROP INDEX storelocations_parent_id_k ON storelocations
     -> CREATE INDEX IDX_7517020727ACA70 ON storelocations (parent_id)
     -> ALTER TABLE storelocations ADD CONSTRAINT storelocations_parent_id_fk FOREIGN KEY (parent_id) REFERENCES storelocations (id)
     -> ALTER TABLE suppliers DROP FOREIGN KEY suppliers_parent_id_fk
     -> ALTER TABLE suppliers ADD default_currency_id INT DEFAULT NULL, ADD shipping_costs NUMERIC(11, 5) DEFAULT NULL, ADD not_selectable TINYINT(1) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE address address VARCHAR(255) NOT NULL, CHANGE phone_number phone_number VARCHAR(255) NOT NULL, CHANGE fax_number fax_number VARCHAR(255) NOT NULL, CHANGE email_address email_address VARCHAR(255) NOT NULL, CHANGE website website VARCHAR(255) NOT NULL, CHANGE auto_product_url auto_product_url VARCHAR(255) NOT NULL, CHANGE comment comment LONGTEXT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
     -> ALTER TABLE suppliers ADD CONSTRAINT FK_AC28B95CECD792C0 FOREIGN KEY (default_currency_id) REFERENCES currencies (id)
     -> CREATE INDEX IDX_AC28B95CECD792C0 ON suppliers (default_currency_id)
     -> DROP INDEX suppliers_parent_id_k ON suppliers
     -> CREATE INDEX IDX_AC28B95C727ACA70 ON suppliers (parent_id)
     -> ALTER TABLE suppliers ADD CONSTRAINT suppliers_parent_id_fk FOREIGN KEY (parent_id) REFERENCES suppliers (id)
     -> DROP INDEX attachements_class_name_k ON attachments
     -> ALTER TABLE attachments DROP FOREIGN KEY attachements_type_id_fk
     -> ALTER TABLE attachments ADD datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE type_id type_id INT DEFAULT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE filename filename VARCHAR(255) NOT NULL, CHANGE show_in_table show_in_table TINYINT(1) NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
     -> ALTER TABLE attachments ADD CONSTRAINT FK_47C4FAD61F1F2A24 FOREIGN KEY (element_id) REFERENCES `parts` (id) ON DELETE CASCADE
     -> DROP INDEX attachements_type_id_fk ON attachments
     -> CREATE INDEX IDX_47C4FAD6C54C8C93 ON attachments (type_id)
     -> CREATE INDEX IDX_47C4FAD61F1F2A24 ON attachments (element_id)
     -> DROP INDEX attachements_element_id_k ON attachments
     -> ALTER TABLE attachments ADD CONSTRAINT attachements_type_id_fk FOREIGN KEY (type_id) REFERENCES attachment_types (id)
     -> ALTER TABLE users CHANGE name name VARCHAR(180) NOT NULL, CHANGE first_name first_name VARCHAR(255) DEFAULT NULL, CHANGE last_name last_name VARCHAR(255) DEFAULT NULL, CHANGE department department VARCHAR(255) DEFAULT NULL, CHANGE email email VARCHAR(255) DEFAULT NULL, CHANGE need_pw_change need_pw_change TINYINT(1) NOT NULL, CHANGE config_language config_language VARCHAR(255) DEFAULT NULL, CHANGE config_timezone config_timezone VARCHAR(255) DEFAULT NULL, CHANGE config_theme config_theme VARCHAR(255) DEFAULT NULL, CHANGE config_currency config_currency VARCHAR(255) NOT NULL, CHANGE perms_labels perms_labels INT NOT NULL, CHANGE last_modified last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
     -> ALTER TABLE users ADD CONSTRAINT FK_1483A5E9FE54D947 FOREIGN KEY (group_id) REFERENCES `groups` (id)
     -> CREATE INDEX IDX_1483A5E9FE54D947 ON users (group_id)
     -> DROP INDEX name ON users
     -> CREATE UNIQUE INDEX UNIQ_1483A5E95E237E06 ON users (name)
     -> DROP INDEX device_parts_combination_uk ON device_parts
     -> ALTER TABLE device_parts CHANGE id_part id_part INT DEFAULT NULL, CHANGE id_device id_device INT DEFAULT NULL, CHANGE quantity quantity INT NOT NULL
     -> ALTER TABLE device_parts ADD CONSTRAINT FK_AFC547992F180363 FOREIGN KEY (id_device) REFERENCES `devices` (id)
     -> ALTER TABLE device_parts ADD CONSTRAINT FK_AFC54799C22F6CC4 FOREIGN KEY (id_part) REFERENCES `parts` (id)
     -> CREATE INDEX IDX_AFC547992F180363 ON device_parts (id_device)
     -> DROP INDEX device_parts_id_device_k ON device_parts
     -> CREATE INDEX IDX_AFC54799C22F6CC4 ON device_parts (id_part)
     -> DROP INDEX device_parts_id_part_k ON device_parts
     -> ALTER TABLE orderdetails ADD last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE id_supplier id_supplier INT DEFAULT NULL, CHANGE supplierpartnr supplierpartnr VARCHAR(255) NOT NULL, CHANGE obsolete obsolete TINYINT(1) NOT NULL, CHANGE supplier_product_url supplier_product_url VARCHAR(255) NOT NULL
     -> ALTER TABLE orderdetails ADD CONSTRAINT FK_489AFCDC4CE34BEC FOREIGN KEY (part_id) REFERENCES `parts` (id) ON DELETE CASCADE
     -> ALTER TABLE orderdetails ADD CONSTRAINT FK_489AFCDCCBF180EB FOREIGN KEY (id_supplier) REFERENCES `suppliers` (id)
     -> CREATE INDEX IDX_489AFCDC4CE34BEC ON orderdetails (part_id)
     -> DROP INDEX orderdetails_part_id_k ON orderdetails
     -> CREATE INDEX IDX_489AFCDCCBF180EB ON orderdetails (id_supplier)
     -> DROP INDEX orderdetails_id_supplier_k ON orderdetails
     -> DROP INDEX pricedetails_combination_uk ON pricedetails
     -> ALTER TABLE pricedetails ADD id_currency INT DEFAULT NULL, ADD datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE price price NUMERIC(11, 5) NOT NULL, CHANGE price_related_quantity price_related_quantity DOUBLE PRECISION NOT NULL, CHANGE min_discount_quantity min_discount_quantity DOUBLE PRECISION NOT NULL, CHANGE manual_input manual_input TINYINT(1) NOT NULL
     -> ALTER TABLE pricedetails ADD CONSTRAINT FK_C68C44594A01DDC7 FOREIGN KEY (orderdetails_id) REFERENCES `orderdetails` (id) ON DELETE CASCADE
     -> ALTER TABLE pricedetails ADD CONSTRAINT FK_C68C4459398D64AA FOREIGN KEY (id_currency) REFERENCES currencies (id)
     -> CREATE INDEX IDX_C68C4459398D64AA ON pricedetails (id_currency)
     -> CREATE INDEX IDX_C68C44594A01DDC7 ON pricedetails (orderdetails_id)
     -> DROP INDEX pricedetails_orderdetails_id_k ON pricedetails
     -> DROP INDEX name ON groups
Migration 20190902140506 failed during Execution. Error An exception occurred while executing 'DROP INDEX name ON groups':

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups' at line 1
22:13:51 ERROR     [console] Error thrown while running command "doctrine:migrations:migrate". Message: "An exception occurred while executing 'DROP INDEX name ON groups':\n\nSQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups' at line 1" ["exception" => Doctrine\DBAL\Exception\SyntaxErrorException^ { …},"command" => "doctrine:migrations:migrate","message" => """  An exception occurred while executing 'DROP INDEX name ON groups':\n  \n  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups' at line 1  """]

In AbstractMySQLDriver.php line 79:
                                                                                                                                                                                                
  An exception occurred while executing 'DROP INDEX name ON groups':                                                                                                                            
                                                                                                                                                                                                
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea  
  r 'groups' at line 1                                                                                                                                                                          
                                                                                                                                                                                                

In PDOConnection.php line 83:
                                                                                                                                                                                                
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea  
  r 'groups' at line 1                                                                                                                                                                          
                                                                                                                                                                                                

In PDOConnection.php line 78:
                                                                                                                                                                                                
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea  
  r 'groups' at line 1                                                                                                                                                                          

Server Side

  • Part-DB Version: Docker Instance, jbtronics/part-db1:latest@sha256:b82b22ab631c005bc67f73fa3085dfb7040f03e95f97c3197340d8471dec59fd
  • PHP Version: as provided by the dockerfile
  • Database Server: MySQL 8.0.20 (as Docker)

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
I already tried to drop the index manually and get the following message back Error 1067: Invalid default value for 'last_modified' SQL Statement: ALTER TABLE partdb.groups CHANGE COLUMNlast_modified last_modifiedTIMESTAMP NOT NULL DEFAULT '00-00-0000 00:00:00'
I also tried to allow 'last_modified' to be NULL and set the default value to NULL without success. That way i can manually drop the index, while the migration script still fails.

Cannot add Images/attachments to Store locations

Describe the bug
When trying to add images to store locations, an internal server error occurs

To Reproduce
Steps to reproduce the behavior:

  1. Edit store location
  2. Add Image by browse
  3. Click on Save
  4. See error

Expected behavior
Like with parts or footprints, locations an image is attached to the location

Screenshots
image

Server Side

  • Part-DB Version: git 44ec940
  • PHP Version: PHP 7.3 (Debian 10.0 Buster)
  • Database Server MariaDB 10.3.23 (Debian 10.0 Buster)

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 85.0.4183.102

Error 500 when editing a part in a not selectable category

I set a category to "not selectable", but this category has still parts in it. When i edit this part and then try to save this part, i get the error message: "Error getting data from Server! Status Code: 500"

There should be a description, what i did wrong.

Save column settings per type and user

Is your feature request related to a problem? Please describe.
When e.g. looking at the list of categories i don't wanna see the detailed description. It's now possible to hide this column but this setting is not saved and therefor I have to hide it every time I click on a category.

Describe the solution you'd like
It would be nice to save this column settings (hidden/shown, sorting direction) for every user and every type of list (e.g. different settings for categories and store locations etc.)

Error page 500 can't connect to database

Describe the bug
After do all config and compilation, when try open index page I am get error page 500, with recommendation to check that database server is launched, and check user name, password and database name. All operations with database thru php bin/console is finished with success. All necessary table are created and etc.

Rebuild with dev flag in .etc.local and get next information:
Uncaught PHP Exception Doctrine\DBAL\Exception\ConnectionException: "An exception occurred in driver: SQLSTATE[HY000] [2002] Unknown error while connecting"
And also highlighting line
'id' => User::ID_ANONYMOUS
From public function getAnonymousUser()
UserRepository.php, line 68

Server Side
Android phone with Linux deploy app where launch Ubuntu 18.04

  • Part-DB Version: 1.0.0-alpha
  • PHP Version: 7.2.34
  • Database Server mariadb-10.4.15

Additional information
Also try add anonymous user into database, but this not help.

php bin/console app:convert-bbcode

Describe the bug
when migrating the database

Expected behavior

php bin/console app:convert-bbcode

Convert entities of class App\Entity\Parts\Part

! [NOTE] Search for entities of type App\Entity\Parts\Part that need ! conversion

10:55:28 ERROR [console] Error thrown while running command "app:convert-bbc
ode". Message: "An exception occurred while executing 'SELECT p0_.datetime_added
AS datetime_added_0, p0_.name AS name_1, p0_.last_modified AS last_modified_2,
p0_.id AS id_3, p0_.needs_review AS needs_review_4, p0_.tags AS tags_5, p0_.mass
AS mass_6, p0_.description AS description_7, p0_.comment AS comment_8, p0_.visi
ble AS visible_9, p0_.favorite AS favorite_10, p0_.minamount AS minamount_11, p0
.manufacturer_product_url AS manufacturer_product_url_12, p0.manufacturer_prod
uct_number AS manufacturer_product_number_13, p0_.manufacturing_status AS manufa
cturing_status_14, p0_.order_quantity AS order_quantity_15, p0_.manual_order AS
manual_order_16, p0_.id_preview_attachement AS id_preview_attachement_17, p0_.id
category AS id_category_18, p0.id_footprint AS id_footprint_19, p0_.id_part_un
it AS id_part_unit_20, p0_.id_manufacturer AS id_manufacturer_21, p0_.order_orde
rdetails_id AS order_orderdetails_id_22 FROM parts p0_ WHERE p0_.description L
IKE ? OR p0_.comment LIKE ?' with params ["%[%]%[/%]%", "%[%]%[/%]%"]:\n\nSQLS
TATE[42S22]: Column not found: 1054 Unknown column 'p0_.needs_review' in 'field
list'" ["exception" => Doctrine\DBAL\Exception\InvalidFieldNameException { },
"command" => "app:convert-bbcode","message" => """ An exception occurred while
executing 'SELECT p0_.datetime_added AS datetime_added_0, p0_.name AS name_1, p0
.last_modified AS last_modified_2, p0.id AS id_3, p0_.needs_review AS needs_re
view_4, p0_.tags AS tags_5, p0_.mass AS mass_6, p0_.description AS description_7
, p0_.comment AS comment_8, p0_.visible AS visible_9, p0_.favorite AS favorite_1
0, p0_.minamount AS minamount_11, p0_.manufacturer_product_url AS manufacturer_p
roduct_url_12, p0_.manufacturer_product_number AS manufacturer_product_number_13
, p0_.manufacturing_status AS manufacturing_status_14, p0_.order_quantity AS ord
er_quantity_15, p0_.manual_order AS manual_order_16, p0_.id_preview_attachement
AS id_preview_attachement_17, p0_.id_category AS id_category_18, p0_.id_footprin
t AS id_footprint_19, p0_.id_part_unit AS id_part_unit_20, p0_.id_manufacturer A
S id_manufacturer_21, p0_.order_orderdetails_id AS order_orderdetails_id_22 FROM
parts p0_ WHERE p0_.description LIKE ? OR p0_.comment LIKE ?' with params ["%
[%]%[/%]%", "%[%]%[/%]%"]:\n \n SQLSTATE[42S22]: Column not found: 1054 Unkn
own column 'p0_.needs_review' in 'field list' """]

In AbstractMySQLDriver.php line 64:

An exception occurred while executing 'SELECT p0_.datetime_added AS datetim
e_added_0, p0_.name AS name_1, p0_.last_modified AS last_modified_2, p0_.id
AS id_3, p0_.needs_review AS needs_review_4, p0_.tags AS tags_5, p0_.mass
AS mass_6, p0_.description AS description_7, p0_.comment AS comment_8, p0_.
visible AS visible_9, p0_.favorite AS favorite_10, p0_.minamount AS minamou
nt_11, p0_.manufacturer_product_url AS manufacturer_product_url_12, p0_.man
ufacturer_product_number AS manufacturer_product_number_13, p0_.manufacturi
ng_status AS manufacturing_status_14, p0_.order_quantity AS order_quantity_
15, p0_.manual_order AS manual_order_16, p0_.id_preview_attachement AS id_p
review_attachement_17, p0_.id_category AS id_category_18, p0_.id_footprint
AS id_footprint_19, p0_.id_part_unit AS id_part_unit_20, p0_.id_manufacture
r AS id_manufacturer_21, p0_.order_orderdetails_id AS order_orderdetails_id
22 FROM parts p0 WHERE p0_.description LIKE ? OR p0_.comment LIKE ?' wi
th params ["%[%]%[/%]%", "%[%]%[/%]%"]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'p0_.needs_review' i
n 'field list'

In PDOStatement.php line 131:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'p0_.needs_review' i
n 'field list'

In PDOStatement.php line 129:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'p0_.needs_review' i
n 'field list'

app:convert-bbcode [--dry-run] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-
V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-deb
ug] [--]

Server Side

  • Part-DB Version: [Part-DB 1.0]
  • PHP Version: [PHP 7.4.10]
  • Database Server [MySQL 7.4.10]

Desktop (please complete the following information):

  • OS: [Win 7]
  • Browser [Crom]
  • Version [?]

Server gets stuck on 500 Internal Server Error if unsupported image attached to part

If you upload any image not supported by gd.so, the server will throw an execption in /var/www/html/vendor/imagine/imagine/src/Gd/Imagine.php at line 95, since createImageFromString($data) above it only creates a valid resource if GD supports the image format.

The GD bundled with the docker image (jbtronics/part-db1:latest) does not support a lot of formats. PNG works, JPEG or WEBP does not.

It should probably fail more gracefully, as you need to delete the file on disk to get PartDB running again.

To Reproduce
Steps to reproduce the behavior:

  1. Add an attachment to any part.
  2. Upload a jpeg.
  3. Wonder why PHP is not able to access the file on disk.

Strange page break in lables

Describe the bug
Sometimes the page break in a lable is a little bit strange. I created a label with the dimensions 26x8mm and added the following content:

<div style="text-align: center;"><strong>[[NAME]]</strong></div>

<div style="text-align: center;"><span style="font-size:6px;">[[PARENT_FULL_PATH]]</span></div>

I also added the following as additional css:

@page {
    margin: 0px 0px;
}

But if you look at the attached screenshot... I would have assumed that the PARENT_FULL_PATH would fit on the first page.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Server Side

  • Part-DB Version: fe405aa
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Firefox
  • Version 76.0.1 (64-Bit)

Migration error with mariadb

I ran into an issue installing partdb with mariadb, I've not the error message any more but if I remember well the database migration tool uses DEFAULT CURRENT_TIMESTAMP on a DATETIME column but it is only supported since mariaDB 10.0.1. Some Linux distribution may not package a recent enough version in their default repositories.

It is probably a good idea to add that information in the readme since it's not obvious when it fails :)

"New part" button in category, etc. lists missing

I cannot find in the DEMO SITE where to add a new part. I would think this is like a MAIN feature and I must be blind to not be able to find it.

In the non-symfony version there is a 'new part in this category' button that I cannot seem to find the equivalent of in this version.

Letzte Aktivitäten nicht aussagekräftig

Ich habe die Beschreibung des Lagerorts geändert:
image

Im Log auf der Startseite steht dann:
image

  1. Ich denke, da sollte dann auch ersichtlich sein, welches Bauteil ich geändert habe.
  2. Als geänderte Eigenschaft ist description nicht eindeutig, es könnte genauso gut die Bauteil-Beschreibung gemeint sein und nicht die vom Lagerort.
  3. Ich habe nicht den Preis geändert, steht trotzdem im Log

Error 500 when undelete the stock first

I deleted a Part with stock. There a 3 entries in the log.
When i try to undelete the stock first, with this button:
image
I get this message:
image

When i first undelete the Part itself and then undelete the Stock, everything is fine. I think there should be an errormessage, which tells me what i did wrong.

Error 500 when adding a new part and footprint filter is applied

Describe the bug
I selected a footprint (e.g. https://part-db.herokuapp.com/en/footprint/65/parts) and pressed the "Create new Part" button --> Error 500. I see the following error in the logfile:
[2020-04-06 22:47:07] request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMException: "The identifier id is missing for a query of App\Entity\Parts\Footprint" at /var/www/partdb/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php line 309 {"exception":"[object] (Doctrine\\ORM\\ORMException(code: 0): The identifier id is missing for a query of App\\Entity\\Parts\\Footprint at /var/www/partdb/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:309)"} []

To Reproduce
Steps to reproduce the behavior:
Please see description above

Expected behavior
Create a new part with the selected footprint pre-selected.

Server Side

  • Part-DB Version: 9a30ea5
  • PHP Version: PHP 7.3.16
  • Database Server 10.3.22-MariaDB-0+deb10u1 Debian 10

Desktop:

  • OS: Windows 10
  • Browser Vivaldi
  • Version 2.11.1811.52 (Stable channel) (32-Bit)

Suggestion: Cost Calculation

From Part-DB #75

It doesn't appear that the quantity breaks are being calculated correctly. When for instance you have a device that uses 10 parts and you make 1 device by clicking remove 1 button.

If you then go to the history of that part the costs displayed at the far right don't follow the quantity breaks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.