Cannot add custom made attribute key
Permalink
Hey there!
The problem is really simple. I made a custom attribute type, and a corresponding key. When I try to add this key to a collection, clicking on it's button in the page properties modal does nothing. In fact, none of the attributes can be added now. Javascript console is telling me, that ccmShowAttributeKey is undefined. So tell me, please, someone more experienced in the development of custom attribute types: what might be causing this? I have ran into this several times before, when developing custom attribute types, but have never seemed to realize what is causeing this and what is the solution. I usually end up reinstalling c5 and building up everything from scratch (with the exact same sourcefiles for the attribute type) and everything would work fine - but this is not an option right now.
UPDATE: putting a console.log() in the start of concrete/elements/collection_metadata_fields.php (the file which is supposed to define ccmShowAttributeKey) it turns out, that the file is correctly opened, javascript loaded right at the start, but for some reason, the end of the file (where *the function* is defined) is not.
The problem is really simple. I made a custom attribute type, and a corresponding key. When I try to add this key to a collection, clicking on it's button in the page properties modal does nothing. In fact, none of the attributes can be added now. Javascript console is telling me, that ccmShowAttributeKey is undefined. So tell me, please, someone more experienced in the development of custom attribute types: what might be causing this? I have ran into this several times before, when developing custom attribute types, but have never seemed to realize what is causeing this and what is the solution. I usually end up reinstalling c5 and building up everything from scratch (with the exact same sourcefiles for the attribute type) and everything would work fine - but this is not an option right now.
UPDATE: putting a console.log() in the start of concrete/elements/collection_metadata_fields.php (the file which is supposed to define ccmShowAttributeKey) it turns out, that the file is correctly opened, javascript loaded right at the start, but for some reason, the end of the file (where *the function* is defined) is not.
![](/files/avatars/none.gif)
In case anyone would stumble into this problem: I have mistyped the loading of the asset library helper, and apparently, the php fatal error, telling me that it cannot include the file, was not printed out on screen for some reason. If you have no idea what is going on, next time, do not forget to check your error logs for hints!
For others who might not be seeing the PHP errors, check your setting in "Dashboard->System and Settings->Debug Settings".
It should be 'Show errors on page' during development and turn it off when the site is live.
Also, sometimes these errors doesn't show on screen but they shows up when you Right-click->View source.
It should be 'Show errors on page' during development and turn it off when the site is live.
Also, sometimes these errors doesn't show on screen but they shows up when you Right-click->View source.
Hi!
Unfortunatelly, it does not work in this case - I just checked it, redoing my previous error and changin the settings. I guess it has to do something with output buffering done in that file. I don't really understand how things are goind on in that file (e.g, when and how it's contents are fetched and displayed). But it is a very good advice, I did not know there was an option for this in the settings. I guess this is going to speed up debugging in general.
Unfortunatelly, it does not work in this case - I just checked it, redoing my previous error and changin the settings. I guess it has to do something with output buffering done in that file. I don't really understand how things are goind on in that file (e.g, when and how it's contents are fetched and displayed). But it is a very good advice, I did not know there was an option for this in the settings. I guess this is going to speed up debugging in general.
Some more suggestions for others passing this way...
You can also check you .htaccess file to see if there are any 'php flag' settings.
Also, you can rename the attached file to 'phpinfo.php' and upload it to your root. Then visit this URL in your browser:
This will show you what your host has set up for error reporting.
You can also check you .htaccess file to see if there are any 'php flag' settings.
Also, you can rename the attached file to 'phpinfo.php' and upload it to your root. Then visit this URL in your browser:
http://www.your-domain/phpinfo.php
This will show you what your host has set up for error reporting.
Can't tell you how grateful I am for your post.
To others reading this, make sure you read the first response, it wasn't until I realised that I wasn't getting errors printed that I found my problem.
If you have an error in your controller somewhere it will render all other attributes useless
To others reading this, make sure you read the first response, it wasn't until I realised that I wasn't getting errors printed that I found my problem.
If you have an error in your controller somewhere it will render all other attributes useless