Patch #35031 » 0001-Remove-WikiContent-Version.patch
| app/helpers/application_helper.rb | ||
|---|---|---|
|
wiki_page = link_project.wiki.find_page(page)
|
||
|
url =
|
||
|
if anchor.present? && wiki_page.present? &&
|
||
|
(obj.is_a?(WikiContent) || obj.is_a?(WikiContent::Version)) &&
|
||
|
(obj.is_a?(WikiContent) || obj.is_a?(WikiContentVersion)) &&
|
||
|
obj.page == wiki_page
|
||
|
"##{anchor}"
|
||
|
else
|
||
| ... | ... | |
|
anchor = sanitize_anchor_name(item)
|
||
|
# used for single-file wiki export
|
||
|
if options[:wiki_links] == :anchor && (obj.is_a?(WikiContent) ||
|
||
|
obj.is_a?(WikiContent::Version))
|
||
|
obj.is_a?(WikiContentVersion))
|
||
|
anchor = "#{obj.page.title}_#{anchor}"
|
||
|
end
|
||
|
@heading_anchors[anchor] ||= 0
|
||
| app/models/user.rb | ||
|---|---|---|
|
Token.where('user_id = ?', id).delete_all
|
||
|
Watcher.where('user_id = ?', id).delete_all
|
||
|
WikiContent.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id])
|
||
|
WikiContent::Version.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id])
|
||
|
WikiContentVersion.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id])
|
||
|
end
|
||
|
# Singleton class method is public
|
||
| app/models/wiki_content.rb | ||
|---|---|---|
|
Mailer.deliver_wiki_content_updated(self)
|
||
|
end
|
||
|
end
|
||
|
# For backward compatibility
|
||
|
# TODO: remove it in Redmine 5
|
||
|
Version = WikiContentVersion
|
||
|
end
|
||
| lib/redmine.rb | ||
|---|---|---|
|
activity.register :news
|
||
|
activity.register :documents, :class_name => %w(Document Attachment)
|
||
|
activity.register :files, :class_name => 'Attachment'
|
||
|
activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false
|
||
|
activity.register :wiki_edits, :class_name => 'WikiContentVersion', :default => false
|
||
|
activity.register :messages, :default => false
|
||
|
activity.register :time_entries, :default => false
|
||
|
end
|
||
| lib/redmine/wiki_formatting/macros.rb | ||
|---|---|---|
|
page = nil
|
||
|
if args.size > 0
|
||
|
page = Wiki.find_page(args.first.to_s, :project => @project)
|
||
|
elsif obj.is_a?(WikiContent) || obj.is_a?(WikiContent::Version)
|
||
|
elsif obj.is_a?(WikiContent) || obj.is_a?(WikiContentVersion)
|
||
|
page = obj.page
|
||
|
else
|
||
|
raise t(:error_childpages_macro_no_argument)
|
||
| test/integration/api_test/wiki_pages_test.rb | ||
|---|---|---|
|
test "PUT /projects/:project_id/wiki/:title.xml should update wiki page" do
|
||
|
assert_no_difference 'WikiPage.count' do
|
||
|
assert_difference 'WikiContent::Version.count' do
|
||
|
assert_difference 'WikiContentVersion.count' do
|
||
|
put(
|
||
|
'/projects/ecookbook/wiki/CookBook_documentation.xml',
|
||
|
:params => {
|
||
| ... | ... | |
|
test "PUT /projects/:project_id/wiki/:title.xml with current versino should update wiki page" do
|
||
|
assert_no_difference 'WikiPage.count' do
|
||
|
assert_difference 'WikiContent::Version.count' do
|
||
|
assert_difference 'WikiContentVersion.count' do
|
||
|
put(
|
||
|
'/projects/ecookbook/wiki/CookBook_documentation.xml',
|
||
|
:params => {
|
||
| ... | ... | |
|
test "PUT /projects/:project_id/wiki/:title.xml with stale version should respond with 409" do
|
||
|
assert_no_difference 'WikiPage.count' do
|
||
|
assert_no_difference 'WikiContent::Version.count' do
|
||
|
assert_no_difference 'WikiContentVersion.count' do
|
||
|
put(
|
||
|
'/projects/ecookbook/wiki/CookBook_documentation.xml',
|
||
|
:params => {
|
||
| ... | ... | |
|
test "PUT /projects/:project_id/wiki/:title.xml should create the page if it does not exist" do
|
||
|
assert_difference 'WikiPage.count' do
|
||
|
assert_difference 'WikiContent::Version.count' do
|
||
|
assert_difference 'WikiContentVersion.count' do
|
||
|
put(
|
||
|
'/projects/ecookbook/wiki/New_page_from_API.xml',
|
||
|
:params => {
|
||
| ... | ... | |
|
set_tmp_attachments_directory
|
||
|
attachment = Attachment.create!(:file => uploaded_test_file("testfile.txt", "text/plain"), :author_id => 2)
|
||
|
assert_difference 'WikiPage.count' do
|
||
|
assert_difference 'WikiContent::Version.count' do
|
||
|
assert_difference 'WikiContentVersion.count' do
|
||
|
put(
|
||
|
'/projects/ecookbook/wiki/New_page_from_API.xml',
|
||
|
:params => {
|
||
| ... | ... | |
|
test "PUT /projects/:project_id/wiki/:title.xml with parent" do
|
||
|
assert_difference 'WikiPage.count' do
|
||
|
assert_difference 'WikiContent::Version.count' do
|
||
|
assert_difference 'WikiContentVersion.count' do
|
||
|
put(
|
||
|
'/projects/ecookbook/wiki/New_subpage_from_API.xml',
|
||
|
:params => {
|
||
| test/unit/activity_test.rb | ||
|---|---|---|
|
end
|
||
|
def test_event_group_for_wiki_content_version
|
||
|
content = WikiContent::Version.find(1)
|
||
|
content = WikiContentVersion.find(1)
|
||
|
assert_equal content.page, content.event_group
|
||
|
end
|
||
| test/unit/project_test.rb | ||
|---|---|---|
|
assert_equal 0, Wiki.count
|
||
|
assert_equal 0, WikiPage.count
|
||
|
assert_equal 0, WikiContent.count
|
||
|
assert_equal 0, WikiContent::Version.count
|
||
|
assert_equal 0, WikiContentVersion.count
|
||
|
assert_equal 0, Project.connection.select_all("SELECT * FROM projects_trackers").count
|
||
|
assert_equal 0, Project.connection.select_all("SELECT * FROM custom_fields_projects").count
|
||
|
assert_equal 0, CustomValue.where(:customized_type => ['Project', 'Issue', 'TimeEntry', 'Version']).count
|
||
| test/unit/user_test.rb | ||
|---|---|---|
|
:start_page => 'Start'))
|
||
|
)
|
||
|
wiki_content.text = 'bar'
|
||
|
assert_difference 'WikiContent::Version.count' do
|
||
|
assert_difference 'WikiContentVersion.count' do
|
||
|
wiki_content.save!
|
||
|
end
|
||
| test/unit/wiki_page_test.rb | ||
|---|---|---|
|
end
|
||
|
def test_diff_for_page_with_deleted_version_should_pick_the_previous_available_version
|
||
|
WikiContent::Version.find_by_page_id_and_version(1, 2).destroy
|
||
|
WikiContentVersion.find_by_page_id_and_version(1, 2).destroy
|
||
|
page = WikiPage.find(1)
|
||
|
diff = page.diff(3)
|
||