Issue Bug Closed

#103476Disrepancy of returned link type in LinktypeInternal::fetchType

Sybille Peters 03/23/24, 16:22 updated 12/02/25, 14:33

Description

Currently, when calling fetchType for various link types differs if you change the order of the link types.

Also, InternalLinktype always returns “db” link type if the “db” link type is set by the softref parser even if it has no business doing so.

These link types are mutually exclusive:

- “db” => InternalLinktype
- “file” => FileLinktype
- “record” => RecordLinktype (introduced in patch via issue #103403)

However, the softref parsers returns “db” for all of these.

Fixing this may avoid problems further down the line.

Test protocol (by debugging the link types)

file link: t3://file?uid=<uid><br>——————————————————-</uid>

$softRefEntry
- value[‘type’] = ‘db’
- value[‘recordRef’] = ‘sys_file:94’
- value[‘tokenValue’] = ‘file:94’

- result of fetchType: (order: db, file)
– if class=InternatlLinktype => AbstactLinktype::fetchType: ‘db’
– if class=FileLinktype => FileLinkType::fetchType: ‘file’

- after changing order: file,db
– if class=FileLinktype => FileLinkType::fetchType: ‘file’
sets $value[‘type’] to ‘file’
– if class=InternatlLinktype => AbstactLinktype::fetchType: ‘file’

!!!! discrepancy !!! effective type depends on order of evaluation!

>> if “file” type is not in “linktypes”, file links will be checked with InteralLinktype
BUT if “file” type is in “linktypes, file links will be checked with FileLinktype

The result is in most cases still ok, because InternalLinktype refuses to check file links, but it is messy, makes troubleshooting difficult and may cause problems in some scenarios.

Reviews 2

History 210

  1. Gerrit Code Review pushed patch set 1 for main to change 83581 status New Under Review 03/23/24, 16:25

  2. Gerrit Code Review pushed patch set 2 for main to change 83581 03/23/24, 16:45

  3. Gerrit Code Review pushed patch set 3 for main to change 83581 05/04/24, 08:29

  4. Gerrit Code Review pushed patch set 4 for main to change 83581 05/04/24, 09:08

  5. Gerrit Code Review pushed patch set 5 for main to change 83581 06/22/24, 05:01

  6. Gerrit Code Review pushed patch set 6 for main to change 83581 02/07/25, 14:44

  7. Gerrit Code Review pushed patch set 7 for main to change 83581 02/07/25, 14:44

  8. Gerrit Code Review pushed patch set 1 for 13.4 to change 88151 02/10/25, 20:23

  9. Sybille Peters commented and changed status Under Review Resolved done 0 % 100 % 02/10/25, 20:25

    Applied in changeset commit:c3d716d54e867fd4323019b6d9b144b826a7800f.

  10. Benni Mack changed status Resolved Closed 12/02/25, 14:33