Sha256: 32204ce9c67885cacfe3ecc48ff6e3e5f82d2ee4d2a8c3d4df99d9db554b6163

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

require 'scrivito/link_parser'

module Scrivito
  class LinkParser
    # Handle legacy mode correctly
    def find_obj_via_id_or_permalink(route_params)
      return unless route_params[:controller] == SCRIVITO_CMS_DISPATCH ||
        route_params[:controller] == 'rails_connector/cms_dispatch' # <-- PATCH HERE

      if id = route_params[:id]
        Obj.find(id)
      elsif permalink = route_params[:permalink]
        Obj.find_by_permalink(permalink)
      end
    rescue Scrivito::ResourceNotFound
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 lib/fiona7/scrivito_patches/link_parser.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/scrivito_patches/link_parser.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/scrivito_patches/link_parser.rb