Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alias / auto_item not working – no items found #1304

Closed
4 tasks done
JoT2 opened this issue Apr 25, 2019 · 3 comments
Closed
4 tasks done

alias / auto_item not working – no items found #1304

JoT2 opened this issue Apr 25, 2019 · 3 comments
Assignees
Labels
invalid This issue just does not seem to be right or did not make sense in MetaModels context

Comments

@JoT2
Copy link

JoT2 commented Apr 25, 2019

Checklist before I submit this issue report

I confirm that:

My environment is:

(Please fill in the actual values from your environment)

Key Value Comments
PHP version: 7.2
Contao version: 4.4.38
MetaModels version: 2.1.1
Installation via composer: (no) Contao-Manager
Installed MetaModels packages:
DCG version: 2.1.3
MM packages:
Core
bundle_filter
bundle_attributes
attribute_url
attribute_translatedurl
attribute_translatedtext
attribute_translatedtags
attribute_translatedtabletext
attribute_translatedselect
attribute_translatedlongtext
attribute_translatedfile
attribute_translatedcombinedvalues
attribute_translatedcheckbox
attribute_translatedalias
attribute_tags
attribute_tabletext
attribute_select
attribute_rating
attribute_numeric
attribute_checkbox

Issue description

Trying to open a detailpage ends in ‚no items found‘ all the time.

Steps to reproduce

  1. set auto_item and Enable folder URLs in Settings to true
  2. create 2 pages
  • listpage
  • detailpage
  1. Create Metamodel with
  • Attributes
    Name [text]
    Alias [alias] (generated via Name-field)
  • Filter: testfilter
    Simple Lookup on attribute alias (URL-Paramerter: auto_item)
  • render: testrender
    jumpTo : detailpage,
    Filter: testfilter
    Attributes: name and alias
  1. Create some TestItems e.g. detailItem_1 and detailItem_2
  2. add MM-List to listpage with no filter and render-settings: testrender
    => ItemList is showing up in FE with detail-link (link is /test/referenz-test/detailitem_1.html e.g. /test/referenz-test/detailitem_2.html)
  3. add MM-List to detailpage with filter testfilter and render-settings testrender

Describe the behaviour of the application

Now click on detail-link of an detailItem on listpage => detailpage (e.g. URL: .../test/referenz-test/detailitem_1.html) is loaded with message 'no items found'

I tried to find the reason and came up to class ItemList in MM core,
function setFilterParameters($arrPresets, $arrValues)
dumping $arrValues I get an array like this:

array:2 [▼
"auto_item" => "test"
"referenz-test" => "detailitem_1"
]
So the value of auto_item is ‚test‘ and not ‚detailItem_1‘. That‘s the reason why I get an ‚item not found‘ I guess because there is no item with alias 'test'.

Describe the expected behaviour of the application

loading detailpage and showing data from detaiItem_1

Forum: https://community.contao.org/de/showthread.php?74737-MM-2-1-und-auto_item

@zonky2 zonky2 added the bug A bug! A bug! Fast, squish it! label Apr 30, 2019
@zonky2 zonky2 added this to the 2.1.2 milestone Apr 30, 2019
@discordier
Copy link
Member

I need more information on your setup.

  1. What are the page aliases?
  2. What part in the above URLs is originating from where.
  3. Are folder URLs in use?

Can you please enhance above recreation steps with the page structure setup (page aliases at minimum).

@discordier discordier added the question We have a question, please elaborate on the ticket. label Apr 30, 2019
@JoT2
Copy link
Author

JoT2 commented May 7, 2019

Sorry for the delay.
Page and Item Aliasses

  1. List page (first level) name: Test, alias: test
  2. Detail page (second level) name: Referenz-TEST, alias: test/referenz-test

Item Aliasses
name: detailItem_1, alias: detailItem_1
name: detailItem_2, alias: detailItem_2

on listpage (test.html) :
mmList (no filter):

Name:
detailItem_2
Alias:
detailitem_2
Details (jumpTo: test/referenz-test/detailitem_2.html)

Name:
detailItem_1
Alias:
detailitem_1
Details (jumpTo: test/referenz-test/detailitem_1.html)

on detailpage (referenz-test)
mmList (filter: Simple lookup, Attribute: Alias, URL parameter: auto_item )
=> There are no items matching your search.

Folder URLs in Use: yes

I hope this helps.

@zonky2
Copy link
Contributor

zonky2 commented May 7, 2019

We have copied your case exactly and found no errors.

If you want someone to take a look at your case, please send an email to mail@metamodel.me for support.

Maybe another extension is guilty...

@zonky2 zonky2 removed the question We have a question, please elaborate on the ticket. label May 7, 2019
@zonky2 zonky2 removed this from the 2.1.2 milestone May 7, 2019
@zonky2 zonky2 added invalid This issue just does not seem to be right or did not make sense in MetaModels context and removed bug A bug! A bug! Fast, squish it! labels May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This issue just does not seem to be right or did not make sense in MetaModels context
Projects
None yet
Development

No branches or pull requests

3 participants