Skip to content

[api] Explicitly passed URL should honored over $el.data.url #2581

@mvorisek

Description

@mvorisek

Bug Report

It seems like a bug, explicitly passed URL to $el.api() should be always preffered.

I have discovered this issue in atk4/ui where we set $modal.url for our purposes - https://github.com/atk4/ui/blob/4.0.0/js/src/plugins/create-modal.plugin.js#L18 - but then query API using the same element like $modal.api(...) with different URL for another purpose.

(for me - https://dev.agiletoolkit.org/demos/interactive/modal.php Multi Step Modal is broken for this reason)

Steps to reproduce

see https://jsfiddle.net/xj02cbog/

Expected result

Explicitly passed URL is preffered over URL from jQuery element data.

Actual result

URL from jQuery element data is preffered.

Version

2.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugAny issue which is a bug or PR which fixes a bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions