가져온 게시물의 소유권을 변경하면, RSS 피드가 새로고침되는 즉시 해당 소유권은 기본 사용자로 되돌려집니다. 새로고침 시 소유권이 변경되지 않도록 할 수 있을까요?
사용 사례: 우리는 블로그에서 게시물을 가져오고 있습니다. 현재 지정된 소유자는 시스템 사용자입니다. 블로그 게시물 작성자가 포럼의 사용자라면, 해당 사용자가 좋아요 및 댓글 알림을 받을 수 있도록 소유권을 수동으로 변경하고자 합니다. 그러나 소유권이 항상 시스템 사용자로 되돌아가기 때문에 이것이 불가능합니다.
관리자가 더 잘 알고 있으므로, 변경된 소유권이 유지되도록 하는 것이 유용할 것입니다. 이 플러그인의 전신에서는 이러한 문제가 없었습니다.
4개의 좋아요
Falco
(Falco)
9월 13, 2022, 3:42오후
2
네, 2018년부터 Discourse 코어가 구현해 온 동작 방식입니다:
master ← xrav3nz:fix-topic-embed-import-should-update-user
merged 07:12AM - 02 May 18 UTC
We ran into a problem where `PollFeed` job didn't update the post author with th… e one found in the RSS feed.
Then I found out `TopicEmbed.import` only updates the post body and neglects new title or author, when a post with the same `embed_url` already exists.
---
Consider the scenario:
1. A blog page with Discourse embedded comment hits `embed_controller#comments`
2. The topic doesn't exist yet, so it tries to fetch the content from RSS feed, but it didn't because feed polling is rate limited
4. It then crawls the webpage and creates a topic with [the default `embed_by_username`](https://github.com/discourse/discourse/blob/ab80986184a498f68d99541c63558ea2089f49d3/lib/topic_retriever.rb#L48)
5. `PollFeed` is schedule to run at a later time, and it fetches the title, content, and author from the RSS feed with [`embed_username_key_from_feed`](https://github.com/discourse/discourse/blob/ab80986184a498f68d99541c63558ea2089f49d3/app/jobs/scheduled/poll_feed.rb#L156).
6. The post should be updated with the title, content and author from the feed.
---
Let me know what you think, cheers! 💪
이 대화를 새 토픽으로 이동하고, 작성자 업데이트를 비활성화하는 플러그인 수준의 설정으로 전환했습니다. 이 작업을 진행하려는 사람은 TopicEmbed.import에 새 매개변수를 추가한 뒤 플러그인에서 이를 사용해야 할 것입니다.
4개의 좋아요