Skip to content

Instantly share code, notes, and snippets.

View takahashim's full-sized avatar

Masayoshi Takahashi takahashim

View GitHub Profile
> 質問です。ProposalStateを編集する画面はありますか?ない場合、どうやれば変更できるでしょうか
⏺ ProposalStateを編集する画面について調査します。
⏺ Search(pattern: "proposal_states", path: "../decidim/decidim-proposals", include: "*controller*")
⎿  Found 1 file (ctrl+r to expand)
⏺ Read(../decidim/decidim-proposals/app/controllers/decidim/proposals/admin/proposal_states_controller.rb)
⎿  Read 87 lines (ctrl+r to expand)
@takahashim
takahashim / issue-proposal-state.md
Created June 16, 2025 09:08
decidim bug report 2025-06-16

Bug Report: ProposalState creation fails with non-ASCII default locale

Description

When the default locale is set to a non-ASCII language (such as Japanese :ja), the create_default_states! method in decidim-proposals fails to create ProposalState records. This prevents proposal components from having the necessary states (evaluating, accepted, rejected), making proposal answering functionality unavailable in the admin interface.

The issue occurs because the generate_token method in ProposalState cannot properly handle non-ASCII characters in titles when generating tokens, and it incorrectly processes symbol tokens passed from create_default_states!.

Steps to Reproduce

Re:VIEW AST導入計画

概要

Re:VIEWの内部アーキテクチャを、現在の直接Builder呼び出し方式から、共通のAST(抽象構文木)を経由する方式に段階的に変更する計画です。

現在の構造

Re:VIEW文書 → Compiler → Builder(各フォーマット) → 出力
ransack.search: 検索
ransack.predicate: は以下である
ransack.and: と
ransack.or: あるいは
ransack.any: いずれか
ransack.all: 全て
ransack.combinator: 組み合わせ
ransack.attribute: 属性
ransack.value: 値
ransack.condition: 状態
diff -uwbNr decidim-cfj/config/application.rb decidim/development_app/config/application.rb
--- decidim-cfj/config/application.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/application.rb 2023-08-21 23:24:55
@@ -1,37 +1,22 @@
-# frozen_string_literal: true
-
require_relative "boot"
-require "decidim/rails"
-# Add the frameworks used by your app that are not loaded by Decidim.
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rails secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you will be exposed to dictionary attacks.
# You can use `rails secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.kdpcommunity.com/s/announcement-archive?language=ja', { waitUntil: 'networkidle0' });
const src = await page.content();
console.log(src);
await browser.close();

Keybase proof

I hereby claim:

  • I am takahashim on github.
  • I am takahashim (https://keybase.io/takahashim) on keybase.
  • I have a public key ASBn56J2GqVP86I5OQrBu0436lbw2bJvdwXS8DHhhpCM0go

To claim this, I am signing this object:

@takahashim
takahashim / decidim-comments.diff
Created November 7, 2022 10:00
git diff 4370eec49fdc6400c5603890c85c45a0e235d8d6 decidim-comments > decidim-comments.diff
diff --git a/decidim-comments/app/cells/decidim/comments/comments/show.erb b/decidim-comments/app/cells/decidim/comments/comments/show.erb
index 982366a..f21dc52 100644
--- a/decidim-comments/app/cells/decidim/comments/comments/show.erb
+++ b/decidim-comments/app/cells/decidim/comments/comments/show.erb
@@ -20,6 +20,11 @@
<%= cell("decidim/comments/comment_thread", comment, order: order) %>
<% end %>
</div>
+ <% if comment_limited? %>
+ <%= link_to commentable_path(limit: 0), class: "button primary expanded" do %>