Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10.0.0-RC1 - cable asset endpoint dropdown jumps to default after reload #10713

Closed
2 tasks done
rbrannath opened this issue Feb 20, 2022 · 2 comments
Closed
2 tasks done

Comments

@rbrannath
Copy link
Contributor

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.0-RC1 - Cable endpoint dropdown of asset type is not persistent

Bug description

When adding/editing a cable asset, the asset type dropdown of the endpoints jump back to the default entry "Computer", after you reload/save the page. The data will be stored correctly, but another save would overwrite the initial data (e. g. asset type "NetworkDevice" was previously set). The data of the specific device incl. socket is lost in this case.

Relevant log output

No log output available

Page URL

/front/cable.form.php

Steps To reproduce

  1. Add NetworkDevices and PassiveDCEquipment with sockets
  2. Add a new cable and fill Endpoints A and B with something else than "Computer" (e. g. a NetworkDevice) and save the element
  3. Reload the page
  4. Asset type jumped back to default entry "Computer". If you save the element again, the initial data is overwritten

Your GLPI setup information

Information about the system, the installation and configuration
GLPI 10.0.0-rc1 ( => /vagrant/glpi)
Installation mode: GIT
Current language:de_DE
Server
 
Operating system: Linux bullseye 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64
PHP 7.4.28 apache2handler (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, calendar, ctype,
	curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imagick, imap, intl, json, libxml, mbstring, mysqli,
	mysqlnd, openssl, pcre, pdo_mysql, posix, readline, session, shmop, soap, sockets, sodium, standard, sysvmsg, sysvsem, sysvshm,
	tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files"
	upload_max_filesize="2M" 
Software: Apache/2.4.52 (Debian) (Apache/2.4.52 (Debian) Server at 192.168.56.10 Port 80
)
	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0
Server Software: MySQL Community Server (GPL)
	Server Version: 5.7.35-log
	Server SQL Mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
	Parameters: root@10.0.2.2/glpidb
	Host info: 10.0.2.2 via TCP/IP

PHP version (7.4.28) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, json, simplexml.
curl extension is installed.
gd extension is installed.
intl extension is installed.
libxml extension is installed.
zlib extension is installed.
Database engine version (5.7.35) is supported.
The log file has been created successfully.
Write access to /vagrant/glpi/files/_cache has been validated.
Write access to /vagrant/glpi/config has been validated.
Write access to /vagrant/glpi/files/_cron has been validated.
Write access to /vagrant/glpi/files has been validated.
Write access to /vagrant/glpi/files/_dumps has been validated.
Write access to /vagrant/glpi/files/_graphs has been validated.
Write access to /vagrant/glpi/files/_lock has been validated.
Write access to /vagrant/glpi/files/_pictures has been validated.
Write access to /vagrant/glpi/files/_plugins has been validated.
Write access to /vagrant/glpi/files/_rss has been validated.
Write access to /vagrant/glpi/files/_sessions has been validated.
Write access to /vagrant/glpi/files/_tmp has been validated.
Write access to /vagrant/glpi/files/_uploads has been validated.
Web access to the files directory should not be allowed
Check the .htaccess file and the web server configuration.
exif extension is installed.
ldap extension is not present.
openssl extension is installed.
zip extension is installed.
bz2 extension is not present.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /vagrant/glpi/marketplace has been validated.
Timezones seems not loaded, see https://glpi-install.readthedocs.io/en/latest/timezones.html.

GLPI constants
 
GLPI_ROOT: /vagrant/glpi
GLPI_CONFIG_DIR: /vagrant/glpi/config
GLPI_VAR_DIR: /vagrant/glpi/files
GLPI_MARKETPLACE_DIR: /vagrant/glpi/marketplace
GLPI_USE_CSRF_CHECK: 1
GLPI_CSRF_EXPIRES: 7200
GLPI_CSRF_MAX_TOKENS: 100
GLPI_USE_IDOR_CHECK: 1
GLPI_IDOR_EXPIRES: 7200
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: 
GLPI_TELEMETRY_URI: https://telemetry.glpi-project.org
GLPI_INSTALL_MODE: GIT
GLPI_NETWORK_MAIL: glpi@teclib.com
GLPI_NETWORK_SERVICES: https://services.glpi-network.com
GLPI_MARKETPLACE_ALLOW_OVERRIDE: 1
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: 1
GLPI_USER_AGENT_EXTRA_COMMENTS: 
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: 1
GLPI_AJAX_DASHBOARD: 1
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: 0
GLPI_CENTRAL_WARNINGS: 1
GLPI_DOC_DIR: /vagrant/glpi/files
GLPI_CACHE_DIR: /vagrant/glpi/files/_cache
GLPI_CRON_DIR: /vagrant/glpi/files/_cron
GLPI_DUMP_DIR: /vagrant/glpi/files/_dumps
GLPI_GRAPH_DIR: /vagrant/glpi/files/_graphs
GLPI_LOCAL_I18N_DIR: /vagrant/glpi/files/_locales
GLPI_LOCK_DIR: /vagrant/glpi/files/_lock
GLPI_LOG_DIR: /vagrant/glpi/files/_log
GLPI_PICTURE_DIR: /vagrant/glpi/files/_pictures
GLPI_PLUGIN_DOC_DIR: /vagrant/glpi/files/_plugins
GLPI_RSS_DIR: /vagrant/glpi/files/_rss
GLPI_SESSION_DIR: /vagrant/glpi/files/_sessions
GLPI_TMP_DIR: /vagrant/glpi/files/_tmp
GLPI_UPLOAD_DIR: /vagrant/glpi/files/_uploads
GLPI_INVENTORY_DIR: /vagrant/glpi/files/_inventories
GLPI_NETWORK_REGISTRATION_API_URL: https://services.glpi-network.com/api/registration/
GLPI_MARKETPLACE_PLUGINS_API_URI: https://services.glpi-network.com/api/glpi-plugins/
GLPI_I18N_DIR: /vagrant/glpi/locales
GLPI_VERSION: 10.0.0-rc1
GLPI_SCHEMA_VERSION: 10.0.0-rc1@4f12cc11183dfb486b84e28e8dad44a9259736c3
GLPI_MARKETPLACE_PRERELEASES: 1
GLPI_MIN_PHP: 7.4.0
GLPI_MAX_PHP: 8.2.0
GLPI_YEAR: 2022
Libraries
 
htmlawed/htmlawed version 1.2.6 in (/vagrant/glpi/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.5.3 in (/vagrant/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/vagrant/glpi/vendor/simplepie/simplepie/library)
mpdf/mpdf in (/vagrant/glpi/vendor/mpdf/mpdf/src)
michelf/php-markdown in (/vagrant/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/vagrant/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/vagrant/glpi/vendor/iamcal/lib_autolink)
sabre/dav in (/vagrant/glpi/vendor/sabre/dav/lib/DAV)
sabre/http in (/vagrant/glpi/vendor/sabre/http/lib)
sabre/uri in (/vagrant/glpi/vendor/sabre/uri/lib)
sabre/vobject in (/vagrant/glpi/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/vagrant/glpi/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/vagrant/glpi/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/vagrant/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/vagrant/glpi/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/vagrant/glpi/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/vagrant/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/vagrant/glpi/vendor/symfony/console)
scssphp/scssphp in (/vagrant/glpi/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/vagrant/glpi/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/vagrant/glpi/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/vagrant/glpi/vendor/rlanvin/php-rrule/src)
blueimp/jquery-file-upload in (/vagrant/glpi/vendor/blueimp/jquery-file-upload/server/php)
ramsey/uuid in (/vagrant/glpi/vendor/ramsey/uuid/src)
psr/log in (/vagrant/glpi/vendor/psr/log/Psr/Log)
psr/simple-cache in (/vagrant/glpi/vendor/psr/simple-cache/src)
psr/cache in (/vagrant/glpi/vendor/psr/cache/src)
league/csv in (/vagrant/glpi/vendor/league/csv/src)
mexitek/phpcolors in (/vagrant/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/vagrant/glpi/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/vagrant/glpi/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/vagrant/glpi/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/vagrant/glpi/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/vagrant/glpi/vendor/paragonie/sodium_compat/src)
symfony/cache in (/vagrant/glpi/vendor/symfony/cache)
html2text/html2text in (/vagrant/glpi/vendor/html2text/html2text/src)
symfony/dom-crawler in (/vagrant/glpi/vendor/symfony/dom-crawler)
twig/twig in (/vagrant/glpi/vendor/twig/twig/src)
twig/string-extra in (/vagrant/glpi/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 in (/vagrant/glpi/vendor/symfony/polyfill-php80)
SQL replicas
 
Not active
Notifications
 
Way of sending emails: PHP
Plugins list
 

Anything else?

No response

@rbrannath
Copy link
Contributor Author

The issue relies in the template file

// /templates/pages/assets)/cable.html.twig
{{ fields.dropdownArrayField(
   'itemtype_endpoint_' ~ side,
    item.fields['connectortypes_id_' ~ side], // this should be -> item.fields['itemtype_endpoint_' ~ side], 
    call('Glpi\\Socket::getSocketLinkTypes'),
    _n('Asset', 'Assets', 1),
    side_options|merge({
       'add_field_html': dropdown_item
    })
) }}

@rbrannath rbrannath changed the title 10.0.0-RC1 10.0.0-RC1 - cable asset endpoint dropdown jumps to default after reload Feb 20, 2022
@cedric-anne
Copy link
Member

Fixed by #10714 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants