Skip to content

#115 [Shortener] fix: guard EASYURL_SHOW_QRCODE user conf read (undefined property warning)#116

Open
nicolas-eoxia wants to merge 1 commit into
Eoxia:developfrom
nicolas-eoxia:fix_qrcode_user_conf_warning
Open

#115 [Shortener] fix: guard EASYURL_SHOW_QRCODE user conf read (undefined property warning)#116
nicolas-eoxia wants to merge 1 commit into
Eoxia:developfrom
nicolas-eoxia:fix_qrcode_user_conf_warning

Conversation

@nicolas-eoxia
Copy link
Copy Markdown
Member

Closes #115

Problem

Rendering the shortener object-info table on a linked element emits:

Warning: Undefined property: stdClass::$EASYURL_SHOW_QRCODE in htdocs/custom/easyurl/class/shortener.class.php on line 525

Cause

EASYURL_SHOW_QRCODE is a per-user setting ($user->conf, from llx_user_param). It was read directly at lines 525 and 544 with no guard, so for any user who never toggled the QR-code switch the property is absent and PHP raises an undefined-property warning.

Fix

Read the optional user param through !empty() (like isset(), it does not warn on a missing property) at both call sites. Behaviour is unchanged for users who have the switch on/off.

php -l passes.

…undefined property warning)

EASYURL_SHOW_QRCODE is a per-user setting ($user->conf). It was read directly at two call sites in the shortener object-info table, raising 'Undefined property: stdClass::$EASYURL_SHOW_QRCODE' for any user who never toggled the QR-code switch. Read it through !empty() (which, like isset(), does not warn on a missing property) in both places.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant