michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
309 stars 49 forks source link

Handling of overwriting printers via "Add printer" broken #76

Closed tillkamppeter closed 3 years ago

tillkamppeter commented 3 years ago

Describe the bug In the PostScript Printer Application I have created several printers to test it during its development. When I now add a new printer via the web interface and give it a queue name of an already existing printer, I do not get a warning that I am overwriting an existing printer, and in addition, a second printer with the same name gets created (see screenshot, "test4" and "test5" are duplicate. Such printers are not accessible separately and they could cause bad interferences, up to a crash (once I got a crash but currently I cannot reproduce it any more).

To Reproduce Fire up a Printer Application and create a printer with the web interface, after that create again a printer with the web interface, using the name of the first printer. After that, the main page lists two printers with the same name.

Expected behavior A warning that one uses a printer name which is already in use and telling the user to enter a different name. To actually change the device and/or driver of an existing printer, the web interface should get an additional configuration page for the printers, reachable by a button in the printer entry, as we already have "Media" and "Printing defaults".

Screenshots Duplicate printer entries "test4" and "test5": Duplicate entries

System Information:

michaelrsweet commented 3 years ago

@tillkamppeter There is no support for changing the device or driver of a printer - once set, you can't change it, and that is intentional. But the add printer interface should definitely protect against creating a duplicate printer.

tillkamppeter commented 3 years ago

I did not test, but the command line interface also should not accept a new printer with an already existing name.

michaelrsweet commented 3 years ago

[master 090ea34] Check whether a named printer already exists (Issue #76)