Creating a Module - Unity3D Integration

Post

Posted
Rating:
Item has a rating of 5 (Liked by Chris Graham)
#7732 (In Topic #2296)
Standard member
Steven Gilson is in the usergroup ‘Fan in training’
Afternoon All

So, restarting my adventures in integrating Unity3D with a Compo.sr based back-end. I'd like to keep my queries together, if that is ok, so if I come up on many different issues, I do apologise.

So today I made a start catching up on things Module related, and was going through the tutorial in the codebook when I ran into 3 problems:

- the get_page_title() function is not recognised by my compo.sr install :(
- what do I need to do to prevent or satisfy this security warning: A POST request was made without a security token; this has been blocked as it represents a security threat.
- my Addons page in the Admin panel gives me a syntax error when my module is present: "Parse error: syntax error, unexpected 'return' (T_RETURN), expecting function (T_FUNCTION) or const (T_CONST) in <snip>/site/sources/zones2.php(794) : eval()'d code on line 37"

Any thoughts out there please?

Kind Regards
Steve
 

Last edit: by Steven Gilson

Online now: No Back to the top

Post

Posted
Rating:
#7733
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hey Steven :),

It turns out the Code Book example is pretty outdated, sorry about that. I'm updating it now. It should go live later today.
(We used to maintain this as a separate document outside the main code repository so it tended to get forgotten)

get_page_title should be get_screen_title.

The form element needs to have {$INSERT_SPAMMER_BLACKHOLE} inside it to add the CSRF token.

The PHP error may be due to code formatting, I'm checking that.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#7734
Standard member
Steven Gilson is in the usergroup ‘Fan in training’
Hi Chris

Thank You for your response! The Example is now working, just my addon page now :(

Now to dig into the Compo.sr manual……

Steve
Online now: No Back to the top

Post

Posted
Rating:
#7735
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
I've updated to live docs.

Also if you want certain formatting errors in modules to not lead to nasty parse errors, this hot-fix will resolve that:
0004609: Don't allow formatting errors in block/module code to cause errors - Composr CMS feature tracker


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#7736
Standard member
Steven Gilson is in the usergroup ‘Fan in training’
OK, cool, thank you. Looking at what you said in your link, I took a look at the galleries.php module to see how you are formatting the code there compared to the tutorial, and copied the info() function exactly, (with my own info for the array) and created empty versions of the uninstall() and install() functions complete with the comments, and my Addon page now works like a charm.

May I suggest a further docs edit to include this learning?

Regards
Steve
Online now: No Back to the top

Post

Posted
Rating:
#7737
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
May I suggest a further docs edit to include this learning?

All hot-fixes get rolled into the next patch release, so there's no need to explain it - it just won't give an error in the future.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top
1 guest and 0 members have just viewed this.
Back to Top