From 9f49ab0edf4de029ea20867b7e1bcffb9b8697f9 Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Mon, 13 Apr 2026 18:46:05 +0200 Subject: [PATCH 1/6] Adds view and manage permissions on work package wiki links plus api path for wiki links --- modules/wikis/lib/open_project/wikis/engine.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/wikis/lib/open_project/wikis/engine.rb b/modules/wikis/lib/open_project/wikis/engine.rb index c1bffc45166b..b9a9f9f03b75 100644 --- a/modules/wikis/lib/open_project/wikis/engine.rb +++ b/modules/wikis/lib/open_project/wikis/engine.rb @@ -63,6 +63,20 @@ class Engine < ::Rails::Engine replace_principal_references "Wikis::PageLink" => %i[author_id] register "openproject-wikis", author_url: "https://openproject.org" do + project_module :work_package_tracking do + permission :view_wiki_page_links, + {}, + permissible_on: :project, + dependencies: %i[view_work_packages], + contract_actions: { wiki_page_links: %i[view] } + + permission :manage_wiki_page_links, + {}, + permissible_on: :project, + dependencies: %i[view_work_packages], + contract_actions: { wiki_page_links: %i[manage] } + end + menu :work_package_split_view, :wikis, { tab: :wikis }, @@ -81,5 +95,7 @@ class Engine < ::Rails::Engine caption: :project_module_wiki_platforms, icon: "browser" end + + add_api_path(:wiki_page_link) { "#{root}/wiki_page_links/#{it}" } end end From 579307168306f55c6dfa7a06ebfc3f1e9d84509c Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Mon, 13 Apr 2026 18:47:02 +0200 Subject: [PATCH 2/6] Adds provisional method named #author? for easy handling of the rendering process --- modules/wikis/app/models/wikis/page_link.rb | 2 ++ modules/wikis/app/models/wikis/relation_page_link.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/wikis/app/models/wikis/page_link.rb b/modules/wikis/app/models/wikis/page_link.rb index c9af679a9ce0..bf743438ae72 100644 --- a/modules/wikis/app/models/wikis/page_link.rb +++ b/modules/wikis/app/models/wikis/page_link.rb @@ -34,5 +34,7 @@ class PageLink < ApplicationRecord belongs_to :provider belongs_to :linkable, polymorphic: true + + def author? = false end end diff --git a/modules/wikis/app/models/wikis/relation_page_link.rb b/modules/wikis/app/models/wikis/relation_page_link.rb index e70377261bf4..a3da4a54ecfb 100644 --- a/modules/wikis/app/models/wikis/relation_page_link.rb +++ b/modules/wikis/app/models/wikis/relation_page_link.rb @@ -31,5 +31,7 @@ module Wikis class RelationPageLink < PageLink belongs_to :author, class_name: "User" + + def author? = true end end From 44bbc3c0d51d7d40905a0bcc4c825da2ad73501b Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Mon, 13 Apr 2026 18:48:33 +0200 Subject: [PATCH 3/6] Adding representer basics --- .../v3/page_links/page_link_representer.rb | 84 +++++++++++++ .../page_links/page_link_representer_spec.rb | 119 ++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 modules/wikis/lib/api/v3/page_links/page_link_representer.rb create mode 100644 modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb diff --git a/modules/wikis/lib/api/v3/page_links/page_link_representer.rb b/modules/wikis/lib/api/v3/page_links/page_link_representer.rb new file mode 100644 index 000000000000..9a747df34fde --- /dev/null +++ b/modules/wikis/lib/api/v3/page_links/page_link_representer.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2023 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module API + module V3 + module PageLinks + class PageLinkRepresenter < Decorators::Single + include Decorators::LinkedResource + include Decorators::DateProperty + include Caching::CachedRepresenter + + property :id + property :identifier + + date_time_property :created_at + date_time_property :updated_at + + # Title being the identifier is kind of a placeholder until we have actual page names + self_link(path: :wiki_page_link, title_getter: ->(*) { represented.identifier }) + + # Implement Permission Checks + link :delete, cache_if: ->(*) { user_allowed_to_manage?(represented) } do + { + href: api_v3_paths.wiki_page_link(represented.id), + method: :delete + } + end + + link :author do + next unless represented.author? + + { + href: api_v3_paths.user(represented.author_id), + title: represented.author.name + } + end + # + # # TODO: Make this truly polymorphic - @mereghost 2026-04-13 + # associated_resource :linkable, + # representer: WorkPackages::WorkPackageRepresenter, + # skip_render: ->(*) { represented.linkable_id.nil? } + + def _type = represented.class.name.demodulize + + private + + def user_allowed_to_manage?(model) + if model.linkable.present? + current_user.allowed_in_project?(:manage_wiki_page_links, model.linkable.project) + else + current_user == model.author + end + end + end + end + end +end diff --git a/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb b/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb new file mode 100644 index 000000000000..7759269db993 --- /dev/null +++ b/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2023 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require "spec_helper" + +module API + module V3 + module PageLinks + RSpec.describe PageLinkRepresenter, :rendering do + include Utilities::PathHelper + + let(:inline_page_link) { build_stubbed(:inline_wiki_page_link) } + let(:relation_page_link) { build_stubbed(:relation_wiki_page_link) } + let(:current_user) { build_stubbed(:user) } + + let(:represented) { relation_page_link } + let(:project) { represented.linkable.project } + + let(:embed_links) { false } + let(:representer) { described_class.new(represented, current_user:, embed_links:) } + + subject(:resulting_json) { representer.to_json } + + describe "_links" do + describe "self" do + it_behaves_like "has a titled link" do + let(:link) { "self" } + let(:href) { "/api/v3/wiki_page_links/#{represented.id}" } + let(:title) { represented.identifier } + end + end + + describe "delete" do + let(:permission) { :manage_wiki_page_links } + + let(:link) { "delete" } + let(:href) { "/api/v3/wiki_page_links/#{represented.id}" } + let(:method) { :delete } + + it_behaves_like "has an untitled action link" + end + + describe "author" do + context "when the page link is an InlinePageLink" do + let(:represented) { inline_page_link } + + it "does not render the author link" do + expect(resulting_json).not_to have_json_path("author") + end + end + + it_behaves_like "has a titled link" do + let(:link) { "author" } + let(:href) { "/api/v3/users/#{represented.author_id}" } + let(:title) { represented.author.name } + end + end + end + + describe "properties" do + describe "_type" do + context "when InlinePageLink" do + let(:represented) { inline_page_link } + + it_behaves_like "property", :_type do + let(:value) { "InlinePageLink" } + end + end + + context "when RelationPageLink" do + it_behaves_like "property", :_type do + let(:value) { "RelationPageLink" } + end + end + end + + it_behaves_like "property", :identifier do + let(:value) { represented.identifier } + end + + it_behaves_like "datetime property", :createdAt do + let(:value) { represented.created_at } + end + + it_behaves_like "datetime property", :updatedAt do + let(:value) { represented.updated_at } + end + end + end + end + end +end From 8c2050f611619e8d7baa00d966e38d235a28e741 Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Mon, 13 Apr 2026 18:59:34 +0200 Subject: [PATCH 4/6] Adds linkable to the response, not polymorphic yet --- .../v3/page_links/page_link_representer.rb | 12 +++++------ .../page_links/page_link_representer_spec.rb | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/modules/wikis/lib/api/v3/page_links/page_link_representer.rb b/modules/wikis/lib/api/v3/page_links/page_link_representer.rb index 9a747df34fde..817564c53642 100644 --- a/modules/wikis/lib/api/v3/page_links/page_link_representer.rb +++ b/modules/wikis/lib/api/v3/page_links/page_link_representer.rb @@ -45,7 +45,6 @@ class PageLinkRepresenter < Decorators::Single # Title being the identifier is kind of a placeholder until we have actual page names self_link(path: :wiki_page_link, title_getter: ->(*) { represented.identifier }) - # Implement Permission Checks link :delete, cache_if: ->(*) { user_allowed_to_manage?(represented) } do { href: api_v3_paths.wiki_page_link(represented.id), @@ -61,11 +60,12 @@ class PageLinkRepresenter < Decorators::Single title: represented.author.name } end - # - # # TODO: Make this truly polymorphic - @mereghost 2026-04-13 - # associated_resource :linkable, - # representer: WorkPackages::WorkPackageRepresenter, - # skip_render: ->(*) { represented.linkable_id.nil? } + + # TODO: Make this truly polymorphic - @mereghost 2026-04-13 + associated_resource :linkable, + v3_path: :work_package, + representer: ::API::V3::WorkPackages::WorkPackageRepresenter, + skip_render: ->(*) { represented.linkable_id.nil? } def _type = represented.class.name.demodulize diff --git a/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb b/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb index 7759269db993..de7319f2fd64 100644 --- a/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb +++ b/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb @@ -65,6 +65,18 @@ module PageLinks let(:method) { :delete } it_behaves_like "has an untitled action link" + + context "when there is no associated linkable" do + before { represented.linkable = nil } + + it_behaves_like "has no link" + + context "and the current user is creator of the file link" do + let(:current_user) { represented.author } + + it { is_expected.to have_json_path("_links/#{link}") } + end + end end describe "author" do @@ -82,6 +94,14 @@ module PageLinks let(:title) { represented.author.name } end end + + describe "linkable" do + it_behaves_like "has a titled link" do + let(:link) { "linkable" } + let(:href) { "/api/v3/work_packages/#{represented.linkable_id}" } + let(:title) { represented.linkable.name } + end + end end describe "properties" do From 51cf1f6d70a87476b3d3e69bde7f7afb90e9a51d Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Tue, 14 Apr 2026 10:23:11 +0200 Subject: [PATCH 5/6] Adds provider to the PageLink resource. Barebones Provider Representer --- modules/wikis/config/locales/en.yml | 2 + .../v3/page_links/page_link_representer.rb | 6 +- .../api/v3/providers/provider_representer.rb | 48 +++++++++++++ .../wikis/lib/open_project/wikis/engine.rb | 1 + .../page_links/page_link_representer_spec.rb | 12 +++- .../v3/providers/provider_representer_spec.rb | 69 +++++++++++++++++++ 6 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 modules/wikis/lib/api/v3/providers/provider_representer.rb create mode 100644 modules/wikis/spec/lib/api/v3/providers/provider_representer_spec.rb diff --git a/modules/wikis/config/locales/en.yml b/modules/wikis/config/locales/en.yml index e5cea0fedf5a..a5e3a217ccec 100644 --- a/modules/wikis/config/locales/en.yml +++ b/modules/wikis/config/locales/en.yml @@ -22,6 +22,8 @@ en: one: Relation page link other: Relation page links wikis/xwiki_provider: XWiki provider + permission_manage_wiki_page_links: Manage Wiki Page Links + permission_view_wiki_page_links: View Wiki Page Links project_module_wiki_platforms: Wiki providers wikis: buttons: diff --git a/modules/wikis/lib/api/v3/page_links/page_link_representer.rb b/modules/wikis/lib/api/v3/page_links/page_link_representer.rb index 817564c53642..222dab606b60 100644 --- a/modules/wikis/lib/api/v3/page_links/page_link_representer.rb +++ b/modules/wikis/lib/api/v3/page_links/page_link_representer.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2023 the OpenProject GmbH +# Copyright (C) the OpenProject GmbH # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. @@ -23,7 +23,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # See COPYRIGHT and LICENSE files for more details. #++ @@ -61,6 +61,8 @@ class PageLinkRepresenter < Decorators::Single } end + associated_resource :provider, v3_path: :wiki_provider + # TODO: Make this truly polymorphic - @mereghost 2026-04-13 associated_resource :linkable, v3_path: :work_package, diff --git a/modules/wikis/lib/api/v3/providers/provider_representer.rb b/modules/wikis/lib/api/v3/providers/provider_representer.rb new file mode 100644 index 000000000000..4dfaee7065ba --- /dev/null +++ b/modules/wikis/lib/api/v3/providers/provider_representer.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module API + module V3 + module Providers + class ProviderRepresenter < Decorators::Single + include Decorators::LinkedResource + include Decorators::DateProperty + + property :id + property :name + + date_time_property :created_at + date_time_property :updated_at + + self_link(path: :wiki_provider) + end + end + end +end diff --git a/modules/wikis/lib/open_project/wikis/engine.rb b/modules/wikis/lib/open_project/wikis/engine.rb index b9a9f9f03b75..edf0a3bbda54 100644 --- a/modules/wikis/lib/open_project/wikis/engine.rb +++ b/modules/wikis/lib/open_project/wikis/engine.rb @@ -97,5 +97,6 @@ class Engine < ::Rails::Engine end add_api_path(:wiki_page_link) { "#{root}/wiki_page_links/#{it}" } + add_api_path(:wiki_provider) { "#{root}/wiki_providers/#{it}" } end end diff --git a/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb b/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb index de7319f2fd64..d915b5247130 100644 --- a/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb +++ b/modules/wikis/spec/lib/api/v3/page_links/page_link_representer_spec.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2023 the OpenProject GmbH +# Copyright (C) the OpenProject GmbH # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. @@ -23,7 +23,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # See COPYRIGHT and LICENSE files for more details. #++ @@ -57,6 +57,14 @@ module PageLinks end end + describe "provider" do + it_behaves_like "has a titled link" do + let(:link) { "provider" } + let(:href) { "/api/v3/wiki_providers/#{represented.provider_id}" } + let(:title) { represented.provider.name } + end + end + describe "delete" do let(:permission) { :manage_wiki_page_links } diff --git a/modules/wikis/spec/lib/api/v3/providers/provider_representer_spec.rb b/modules/wikis/spec/lib/api/v3/providers/provider_representer_spec.rb new file mode 100644 index 000000000000..602bae7b9635 --- /dev/null +++ b/modules/wikis/spec/lib/api/v3/providers/provider_representer_spec.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require "spec_helper" + +module API + module V3 + module Providers + RSpec.describe ProviderRepresenter, :rendering do + let(:xwiki_provider) { build_stubbed(:xwiki_provider) } + let(:internal_provider) { build_stubbed(:internal_wiki_provider) } + let(:embed_links) { false } + let(:current_user) { build_stubbed(:user) } + + let(:represented) { xwiki_provider } + let(:representer) { described_class.new(represented, current_user:, embed_links:) } + + subject(:rendered) { representer.to_json } + + describe "_links" do + describe "self" do + it_behaves_like "has a titled link" do + let(:link) { "self" } + let(:href) { "/api/v3/wiki_providers/#{represented.id}" } + let(:title) { represented.name } + end + end + end + + describe "properties" do + it_behaves_like "datetime property", :createdAt do + let(:value) { represented.created_at } + end + + it_behaves_like "datetime property", :updatedAt do + let(:value) { represented.updated_at } + end + end + end + end + end +end From 7c5c125a3427bdbf0edc657c59885ec5d705957f Mon Sep 17 00:00:00 2001 From: Marcello Rocha Date: Wed, 15 Apr 2026 10:21:16 +0200 Subject: [PATCH 6/6] Rename link parameters, make author? into render_author? as more intention revealingskip render if linkable is not a WP --- modules/wikis/app/models/wikis/page_link.rb | 2 +- modules/wikis/app/models/wikis/relation_page_link.rb | 2 +- modules/wikis/lib/api/v3/page_links/page_link_representer.rb | 4 ++-- modules/wikis/lib/open_project/wikis/engine.rb | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/wikis/app/models/wikis/page_link.rb b/modules/wikis/app/models/wikis/page_link.rb index bf743438ae72..e9e9a861471e 100644 --- a/modules/wikis/app/models/wikis/page_link.rb +++ b/modules/wikis/app/models/wikis/page_link.rb @@ -35,6 +35,6 @@ class PageLink < ApplicationRecord belongs_to :provider belongs_to :linkable, polymorphic: true - def author? = false + def render_author? = false end end diff --git a/modules/wikis/app/models/wikis/relation_page_link.rb b/modules/wikis/app/models/wikis/relation_page_link.rb index a3da4a54ecfb..4f22e3183288 100644 --- a/modules/wikis/app/models/wikis/relation_page_link.rb +++ b/modules/wikis/app/models/wikis/relation_page_link.rb @@ -32,6 +32,6 @@ module Wikis class RelationPageLink < PageLink belongs_to :author, class_name: "User" - def author? = true + def render_author? = true end end diff --git a/modules/wikis/lib/api/v3/page_links/page_link_representer.rb b/modules/wikis/lib/api/v3/page_links/page_link_representer.rb index 222dab606b60..a0c80d5f2a6a 100644 --- a/modules/wikis/lib/api/v3/page_links/page_link_representer.rb +++ b/modules/wikis/lib/api/v3/page_links/page_link_representer.rb @@ -53,7 +53,7 @@ class PageLinkRepresenter < Decorators::Single end link :author do - next unless represented.author? + next unless represented.render_author? { href: api_v3_paths.user(represented.author_id), @@ -67,7 +67,7 @@ class PageLinkRepresenter < Decorators::Single associated_resource :linkable, v3_path: :work_package, representer: ::API::V3::WorkPackages::WorkPackageRepresenter, - skip_render: ->(*) { represented.linkable_id.nil? } + skip_render: ->(*) { represented.linkable_id.nil? || represented.linkable_type != "WorkPackage" } def _type = represented.class.name.demodulize diff --git a/modules/wikis/lib/open_project/wikis/engine.rb b/modules/wikis/lib/open_project/wikis/engine.rb index edf0a3bbda54..386a733b89b6 100644 --- a/modules/wikis/lib/open_project/wikis/engine.rb +++ b/modules/wikis/lib/open_project/wikis/engine.rb @@ -96,7 +96,7 @@ class Engine < ::Rails::Engine icon: "browser" end - add_api_path(:wiki_page_link) { "#{root}/wiki_page_links/#{it}" } - add_api_path(:wiki_provider) { "#{root}/wiki_providers/#{it}" } + add_api_path(:wiki_page_link) { |page_link_id| "#{root}/wiki_page_links/#{page_link_id}" } + add_api_path(:wiki_provider) { |provider_id| "#{root}/wiki_providers/#{provider_id}" } end end