Leading underscore for details table in PHP files

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
whynick
User
Posts: 45

Leading underscore for details table in PHP files

Post by whynick »

hi all,

i'm testing V2019 (as i'm still on v12) and generating php scripts for all detail tables but a leading underscore "_" will be generated.

example from v12:
cars_mainlist.php (master table)
cars_detailslist.php (details table) will be generated in v2019.0.10 as _cars_detailslist.php
what is the reason and how to avoid that leading underscore?

i have the issue that i do have a lot of postings in a forum to the database, and non links would be found anymore
example with v12:
domain/cars_detailslist.php?showmaster=cars_main&fk_car_id=1346
new links would be
domain/_cars_detailslist.php?showmaster=cars_main&fk_car_id=1346

right now i have all dead links (error 404) as _cars_detailslist.php?showmaster=cars_main&fk_car_id=1346 can't be found

thank you in advance!


mobhar
User
Posts: 11741

Post by mobhar »

Make sure you have already selected "None" from "Generate" -> "Output filename", and remove any character from "Prefix/Infix/Suffix" directive, then re-generate ALL the script files again, and then try again.


arbei
User
Posts: 9396

Post by arbei »

Cannot simulate. Make sure that you have set [Output filename] to "None" as suggested by mobhar.

Note that if [Output filename] is set to "None", this will only occur if you have a table with table name like "<table>_<id>" where "<table>" is a certain table name and "<id>" match with a certain control id in the control.xml (e.g. "cars_view"). If you are using third party extensions, make sure that you do not have controls like "main" or "details" in your third party extensions.


whynick
User
Posts: 45

Post by whynick »

morning arbei, morning mobhar,

thank you for your answers!
all those settings are OK and non third party is involved.

i have found out that the issues with leading(prefix) underscore in php filenames are my table names within PHPMAKER 2019.0.10

my live ones (here 2 of few hundred):
cars_bmw (master)
cars_bmw_info (detail)

when i rename table cars_bmw_info to cars_bmwinfo (please note the 2nd "_" after "bmw" is removed) the leading underscore will not be used.
when i rename cars_bmwinfo back to cars_bmw_info the issue with leading underscore is back. :)

this issue was not within V12.. not sure with followed versions. i'm just testing the 2019.0.10 right now.

cheers


arbei
User
Posts: 9396

Post by arbei »

The name "info" clashes with one of the control ids. If possible, change your table name (e.g., to "cars_bmwinfo" or "cars_bmw_inf").


whynick
User
Posts: 45

Post by whynick »

hi guys,

as there are hundred of tables for CARS(vehicles)
there were a lot of changes to be done.. rename of hundreds of tables, changes of hundreds phpmaker tables (migrate old to new table), changes of thousands links in the forums..
i solved it in another way with .htaccess (few hundred redirects)

Redirect permanent /cars_bmw_infolist.php /_cars_bmw_infolist.php
etc..

however, thank you for your answers in this thread.
cheers
Nicky


Post Reply